本文整理汇总了Java中org.elasticsearch.search.aggregations.metrics.stats.extended.ExtendedStatsBuilder类的典型用法代码示例。如果您正苦于以下问题:Java ExtendedStatsBuilder类的具体用法?Java ExtendedStatsBuilder怎么用?Java ExtendedStatsBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExtendedStatsBuilder类属于org.elasticsearch.search.aggregations.metrics.stats.extended包,在下文中一共展示了ExtendedStatsBuilder类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extendedStatsQuery
import org.elasticsearch.search.aggregations.metrics.stats.extended.ExtendedStatsBuilder; //导入依赖的package包/类
public static void extendedStatsQuery(Client client ) {
SearchResponse res = null;
ExtendedStatsBuilder agg = AggregationBuilders
.extendedStats("extended_stats_num")
.field("like");
res = client.prepareSearch("search_test")
.setTypes("article")
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.addAggregation(agg)
.setFrom(0)
.setSize(10)
.execute().actionGet();
System.out.println(res);
// on shutdown
client.close();
}
示例2: extendedStats
import org.elasticsearch.search.aggregations.metrics.stats.extended.ExtendedStatsBuilder; //导入依赖的package包/类
/**
* Create a new {@link ExtendedStats} aggregation with the given name.
*/
public static ExtendedStatsBuilder extendedStats(String name) {
return new ExtendedStatsBuilder(name);
}
示例3: createNumericSearchBuilder
import org.elasticsearch.search.aggregations.metrics.stats.extended.ExtendedStatsBuilder; //导入依赖的package包/类
private SearchRequestBuilder createNumericSearchBuilder(Collection<FieldInfo> fields) {
SearchRequestBuilder builder = client.prepareSearch(indexName);
for(FieldInfo info : fields) {
ExtendedStatsBuilder stats = AggregationBuilders.extendedStats(EXTENDED_STATS_AGG + info.getFullPath()).field(info.getFullPath());
QueryBuilder filter = new BoolQueryBuilder().filter(new ExistsQueryBuilder(info.getFullPath()));
FilterAggregationBuilder aggregation = AggregationBuilders.filter(FILTER_AGG + info.getFullPath()).filter(filter).subAggregation(stats);
builder.addAggregation(createNestedIfNecessary(info, aggregation));
}
builder.setSize(ZERO_ITEMS);
return builder;
}