本文整理汇总了Java中org.elasticsearch.search.aggregations.metrics.valuecount.ValueCountBuilder类的典型用法代码示例。如果您正苦于以下问题:Java ValueCountBuilder类的具体用法?Java ValueCountBuilder怎么用?Java ValueCountBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ValueCountBuilder类属于org.elasticsearch.search.aggregations.metrics.valuecount包,在下文中一共展示了ValueCountBuilder类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createStringSearchBuilder
import org.elasticsearch.search.aggregations.metrics.valuecount.ValueCountBuilder; //导入依赖的package包/类
private SearchRequestBuilder createStringSearchBuilder(Collection<FieldInfo> fields) {
SearchRequestBuilder builder = client.prepareSearch(indexName);
for(FieldInfo info : fields) {
TermsBuilder tokenBuilder = AggregationBuilders.terms(TERMS_AGG + info.getFullPath())
.field(info.getFullPath())
.minDocCount(props.getStringTokenMinOccurent())
.size(props.getStringTokenLimit());
builder.addAggregation(createNestedIfNecessary(info, tokenBuilder));
ValueCountBuilder countBuilder = AggregationBuilders.count(VALUE_COUNT_AGG + info.getFullPath()).field(info.getFullPath());
QueryBuilder filter = new BoolQueryBuilder().filter(new ExistsQueryBuilder(info.getFullPath()));
FilterAggregationBuilder filterBuilder = AggregationBuilders.filter(FILTER_AGG + info.getFullPath()).filter(filter).subAggregation(countBuilder);
builder.addAggregation(createNestedIfNecessary(info, filterBuilder));
}
builder.setSize(ZERO_ITEMS);
return builder;
}
示例2: newCount
import org.elasticsearch.search.aggregations.metrics.valuecount.ValueCountBuilder; //导入依赖的package包/类
public static AbstractAggregationBuilder newCount(Function func) {
ValueCountBuilder count;
count = AggregationBuilders.count(Function.genStatField(func))
.field(func.field);
return count;
}
示例3: count
import org.elasticsearch.search.aggregations.metrics.valuecount.ValueCountBuilder; //导入依赖的package包/类
/**
* Create a new {@link ValueCount} aggregation with the given name.
*/
public static ValueCountBuilder count(String name) {
return new ValueCountBuilder(name);
}