Package org.elasticsearch

Examples of org.elasticsearch.ElasticsearchParseException


            if (mappingMetaData != null) {
                try {
                    Map<String, Object> mapping = mappingMetaData.sourceAsMap();
                    viewContext = extract(mapping, request.format());
                } catch (IOException e) {
                    throw new ElasticSearchParseException("Failed to parse mapping content to map", e);
                }
            }
        }

        if (viewContext == null) {
View Full Code Here


        }
        if (LZF.isCompressed(value)) {
            try {
                return LZFDecoder.decode(value);
            } catch (IOException e) {
                throw new ElasticSearchParseException("failed to decompress source", e);
            }
        }
        return value;
    }
View Full Code Here

        }
        if (LZF.isCompressed(source)) {
            try {
                this.source = LZFDecoder.decode(source);
            } catch (IOException e) {
                throw new ElasticSearchParseException("failed to decompress source", e);
            }
        }
        return this.source;
    }
View Full Code Here

            parser = XContentFactory.xContent(source).createParser(source);
            sourceAsMap = parser.map();
            parser.close();
            return sourceAsMap;
        } catch (Exception e) {
            throw new ElasticSearchParseException("Failed to parse source to map", e);
        } finally {
            if (parser != null) {
                parser.close();
            }
        }
View Full Code Here

            Document doc = reader.document(docId, SourceFieldSelector.INSTANCE);
            Fieldable sourceField = doc.getFieldable(SourceFieldMapper.NAME);
            byte[] source = sourceField.getBinaryValue();
            this.source = sourceAsMap(source, 0, source.length);
        } catch (Exception e) {
            throw new ElasticSearchParseException("failed to parse / load source", e);
        } finally {
            if (parser != null) {
                parser.close();
            }
        }
View Full Code Here

            } else {
                parser = XContentFactory.xContent(bytes, offset, length).createParser(bytes, offset, length);
                return parser.map();
            }
        } catch (Exception e) {
            throw new ElasticSearchParseException("Failed to parse source to map", e);
        } finally {
            if (parser != null) {
                parser.close();
            }
        }
View Full Code Here

        if (data.doc() == null) {
            fieldSelector.name(data.mapper().names().indexName());
            try {
                data.doc(reader.document(docId, fieldSelector));
            } catch (IOException e) {
                throw new ElasticSearchParseException("failed to load field [" + name + "]", e);
            }
        }
        return data;
    }
View Full Code Here

     * Guesses the content (type) based on the provided char sequence.
     */
    public static XContent xContent(CharSequence content) {
        XContentType type = xContentType(content);
        if (type == null) {
            throw new ElasticSearchParseException("Failed to derive xcontent from " + content);
        }
        return xContent(type);
    }
View Full Code Here

     * Guesses the content type based on the provided bytes.
     */
    public static XContent xContent(byte[] data, int offset, int length) {
        XContentType type = xContentType(data, offset, length);
        if (type == null) {
            throw new ElasticSearchParseException("Failed to derive xcontent from (offset=" + offset + ", length=" + length + "): " + Arrays.toString(data));
        }
        return xContent(type);
    }
View Full Code Here

            } else {
                millis = Long.parseLong(sValue);
            }
            return new TimeValue(millis, TimeUnit.MILLISECONDS);
        } catch (NumberFormatException e) {
            throw new ElasticSearchParseException("Failed to parse [" + sValue + "]", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.ElasticsearchParseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.