当前位置: 首页>>代码示例>>Java>>正文


Java ValueCountBuilder类代码示例

本文整理汇总了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;
}
 
开发者ID:kucera-jan-cz,项目名称:esBench,代码行数:18,代码来源:FieldAnalyzer.java

示例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;
}
 
开发者ID:huangchen007,项目名称:elasticsearch-rest-command,代码行数:8,代码来源:AST_Stats.java

示例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);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:7,代码来源:AggregationBuilders.java


注:本文中的org.elasticsearch.search.aggregations.metrics.valuecount.ValueCountBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。