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