Package org.elasticsearch.index.query

Examples of org.elasticsearch.index.query.QueryParseContext


            throw new ElasticsearchIllegalArgumentException("failed to parse filter for alias [" + alias + "]", e);
        }
    }

    private void validateAliasFilter(XContentParser parser, IndexQueryParserService indexQueryParserService) throws IOException {
        QueryParseContext context = indexQueryParserService.getParseContext();
        try {
            context.reset(parser);
            context.setAllowUnmappedFields(false);
            context.parseInnerFilter();
        } finally {
            context.reset(null);
            parser.close();
        }
    }
View Full Code Here


    private Query parseQuery(String type, XContentParser parser) {
        String[] previousTypes = null;
        if (type != null) {
            QueryParseContext.setTypesWithPrevious(new String[]{type});
        }
        QueryParseContext context = cache.get();
        try {
            context.reset(parser);
            context.setAllowUnmappedFields(allowUnmappedFields);
            return queryParserService.parseInnerQuery(context);
        } catch (IOException e) {
            throw new QueryParsingException(queryParserService.index(), "Failed to parse", e);
        } finally {
            if (type != null) {
                QueryParseContext.setTypes(previousTypes);
            }
            context.reset(null);
        }
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.query.QueryParseContext

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.