本文整理匯總了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);
}