当前位置: 首页>>代码示例>>Java>>正文


Java QueryBuilder.rewriteQuery方法代码示例

本文整理汇总了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);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:FilterAggregationBuilder.java

示例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);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:AliasFilter.java

示例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;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:AbstractQueryTestCase.java

示例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);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:AliasValidator.java


注:本文中的org.elasticsearch.index.query.QueryBuilder.rewriteQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。