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