當前位置: 首頁>>代碼示例>>Java>>正文


Java QueryParseContext.parseInnerQueryBuilder方法代碼示例

本文整理匯總了Java中org.elasticsearch.index.query.QueryParseContext.parseInnerQueryBuilder方法的典型用法代碼示例。如果您正苦於以下問題:Java QueryParseContext.parseInnerQueryBuilder方法的具體用法?Java QueryParseContext.parseInnerQueryBuilder怎麽用?Java QueryParseContext.parseInnerQueryBuilder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.elasticsearch.index.query.QueryParseContext的用法示例。


在下文中一共展示了QueryParseContext.parseInnerQueryBuilder方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parseQueryBuilder

import org.elasticsearch.index.query.QueryParseContext; //導入方法依賴的package包/類
private static QueryBuilder parseQueryBuilder(QueryParseContext context, XContentLocation location) {
    try {
        return context.parseInnerQueryBuilder();
    } catch (IOException e) {
        throw new ParsingException(location, "Failed to parse", e);
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:8,代碼來源:PercolatorFieldMapper.java

示例2: doRewrite

import org.elasticsearch.index.query.QueryParseContext; //導入方法依賴的package包/類
@Override
protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws IOException {
    BytesReference querySource = queryRewriteContext.getTemplateBytes(template);
    try (XContentParser qSourceParser = XContentFactory.xContent(querySource).createParser(queryRewriteContext.getXContentRegistry(),
            querySource)) {
        final QueryParseContext queryParseContext = queryRewriteContext.newParseContext(qSourceParser);
        final QueryBuilder queryBuilder = queryParseContext.parseInnerQueryBuilder();
        if (boost() != DEFAULT_BOOST || queryName() != null) {
            final BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder();
            boolQueryBuilder.must(queryBuilder);
            return boolQueryBuilder;
        }
        return queryBuilder;
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:16,代碼來源:TemplateQueryBuilder.java

示例3: parseNestedFilter

import org.elasticsearch.index.query.QueryParseContext; //導入方法依賴的package包/類
protected static QueryBuilder parseNestedFilter(XContentParser parser, QueryParseContext context) {
    try {
        return context.parseInnerQueryBuilder();
    } catch (Exception e) {
        throw new ParsingException(parser.getTokenLocation(), "Expected " + NESTED_FILTER_FIELD.getPreferredName() + " element.", e);
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:8,代碼來源:SortBuilder.java

示例4: parseQuery

import org.elasticsearch.index.query.QueryParseContext; //導入方法依賴的package包/類
protected static QueryBuilder parseQuery(XContentParser parser) throws IOException {
    QueryParseContext context = createParseContext(parser);
    QueryBuilder parseInnerQueryBuilder = context.parseInnerQueryBuilder();
    assertNull(parser.nextToken());
    return parseInnerQueryBuilder;
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:7,代碼來源:AbstractQueryTestCase.java

示例5: parse

import org.elasticsearch.index.query.QueryParseContext; //導入方法依賴的package包/類
public static FilterAggregationBuilder parse(String aggregationName, QueryParseContext context) throws IOException {
    QueryBuilder filter = context.parseInnerQueryBuilder();
    return new FilterAggregationBuilder(aggregationName, filter);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:5,代碼來源:FilterAggregationBuilder.java

示例6: validateAliasFilter

import org.elasticsearch.index.query.QueryParseContext; //導入方法依賴的package包/類
private static void validateAliasFilter(XContentParser parser, QueryShardContext queryShardContext) throws IOException {
    QueryParseContext queryParseContext = queryShardContext.newParseContext(parser);
    QueryBuilder parseInnerQueryBuilder = queryParseContext.parseInnerQueryBuilder();
    QueryBuilder queryBuilder = QueryBuilder.rewriteQuery(parseInnerQueryBuilder, queryShardContext);
    queryBuilder.toFilter(queryShardContext);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:7,代碼來源:AliasValidator.java


注:本文中的org.elasticsearch.index.query.QueryParseContext.parseInnerQueryBuilder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。