本文整理汇总了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);
}
}
示例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;
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}