本文整理汇总了Java中org.elasticsearch.index.query.QueryBuilder.rewriteQuery方法的典型用法代码示例。如果您正苦于以下问题:Java QueryBuilder.rewriteQuery方法的具体用法?Java QueryBuilder.rewriteQuery怎么用?Java QueryBuilder.rewriteQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.index.query.QueryBuilder
的用法示例。
在下文中一共展示了QueryBuilder.rewriteQuery方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doBuild
import org.elasticsearch.index.query.QueryBuilder; //导入方法依赖的package包/类
@Override
protected AggregatorFactory<?> doBuild(SearchContext context, AggregatorFactory<?> parent,
AggregatorFactories.Builder subFactoriesBuilder) throws IOException {
// TODO this sucks we need a rewrite phase for aggregations too
final QueryBuilder rewrittenFilter = QueryBuilder.rewriteQuery(filter, context.getQueryShardContext());
return new FilterAggregatorFactory(name, rewrittenFilter, context, parent, subFactoriesBuilder, metaData);
}
示例2: rewrite
import org.elasticsearch.index.query.QueryBuilder; //导入方法依赖的package包/类
AliasFilter rewrite(QueryRewriteContext context) throws IOException {
QueryBuilder queryBuilder = reparseFilter(context);
if (queryBuilder != null) {
return new AliasFilter(QueryBuilder.rewriteQuery(queryBuilder, context), aliases);
}
return new AliasFilter(filter, aliases);
}
示例3: rewriteQuery
import org.elasticsearch.index.query.QueryBuilder; //导入方法依赖的package包/类
private QueryBuilder rewriteQuery(QB queryBuilder, QueryRewriteContext rewriteContext) throws IOException {
QueryBuilder rewritten = QueryBuilder.rewriteQuery(queryBuilder, rewriteContext);
// extra safety to fail fast - serialize the rewritten version to ensure it's serializable.
assertSerialization(rewritten);
return rewritten;
}
示例4: validateAliasFilter
import org.elasticsearch.index.query.QueryBuilder; //导入方法依赖的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);
}