當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。