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


Java TermsBuilder.size方法代码示例

本文整理汇总了Java中org.elasticsearch.search.aggregations.bucket.terms.TermsBuilder.size方法的典型用法代码示例。如果您正苦于以下问题:Java TermsBuilder.size方法的具体用法?Java TermsBuilder.size怎么用?Java TermsBuilder.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.search.aggregations.bucket.terms.TermsBuilder的用法示例。


在下文中一共展示了TermsBuilder.size方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildAggregationQuery

import org.elasticsearch.search.aggregations.bucket.terms.TermsBuilder; //导入方法依赖的package包/类
/**
 * Adds aggregations recursively
 * All metric columns are added to last aggregation
 * @param aggs
 * @param index
 * @param metrics
 * @return
 */
private TermsBuilder buildAggregationQuery(List<Column> aggs, int index, QueryState state){
	Column agg = aggs.get(index);
	TermsBuilder result = null;
	if(aggs.get(index).getOp() == Operation.NONE){
		result = AggregationBuilders.terms(agg.getAggName()).field(agg.getColumn());
		result.size(state.getIntProp(Utils.PROP_FETCH_SIZE, 10000));
	}
	if(index < aggs.size() - 1) result.subAggregation(buildAggregationQuery(aggs, index+1, state));
	else addMetrics(result, state.getHeading(), true); 
	return result;
}
 
开发者ID:Anchormen,项目名称:sql4es,代码行数:20,代码来源:GroupParser.java

示例2: SimpleAggregationBuilder

import org.elasticsearch.search.aggregations.bucket.terms.TermsBuilder; //导入方法依赖的package包/类
public SimpleAggregationBuilder(PB parentBuilder, TermsBuilder terms, String field, Integer size) {
	super(parentBuilder);
	if(size!=null){
		terms.size(size);
	}
	if(StringUtils.isNotBlank(field)){
		terms.field(field);
	}
	terms.order(Terms.Order.count(false));//COUNT_DESC
	this.aggsBuilder = terms;
}
 
开发者ID:wayshall,项目名称:onetwo,代码行数:12,代码来源:SimpleSearchQueryBuilder.java

示例3: buildAggregation

import org.elasticsearch.search.aggregations.bucket.terms.TermsBuilder; //导入方法依赖的package包/类
private AbstractAggregationBuilder buildAggregation(StatsTrendRequest request) {
    DateHistogram.Interval interval = Utils.getHistogramInterval(request.getPeriod());
    AbstractAggregationBuilder dateHistogramBuilder = Utils.buildDateHistogramAggregation(request.getTimestamp(), interval)
            .subAggregation(Utils.buildExtendedStatsAggregation(request.getField()))
            .subAggregation(Utils.buildPercentileAggregation(request.getField()));

    if (CollectionUtils.isNullOrEmpty(getParameter().getNesting())) {
        return dateHistogramBuilder;
    }

    TermsBuilder rootBuilder = null;
    TermsBuilder termsBuilder = null;
    for (String field : getParameter().getNesting()) {
        if (null == termsBuilder) {
            termsBuilder = AggregationBuilders.terms(Utils.sanitizeFieldForAggregation(field)).field(field);
        } else {
            TermsBuilder tempBuilder = AggregationBuilders.terms(Utils.sanitizeFieldForAggregation(field)).field(field);
            termsBuilder.subAggregation(tempBuilder);
            termsBuilder = tempBuilder;
        }
        termsBuilder.size(0);
        if (null == rootBuilder) {
            rootBuilder = termsBuilder;
        }
    }
    termsBuilder.subAggregation(dateHistogramBuilder);
    return rootBuilder;
}
 
开发者ID:Flipkart,项目名称:foxtrot,代码行数:29,代码来源:StatsTrendAction.java

示例4: convert

import org.elasticsearch.search.aggregations.bucket.terms.TermsBuilder; //导入方法依赖的package包/类
@Override
public AggregationBuilder convert(QueryConverter queryConverter, Aggregation aggregation) {

    TermsBuilder result = terms(getName(aggregation));

    addField(aggregation, result);
    addScript(aggregation, result);

    Integer limit = aggregation.getInteger("limit");
    if (limit != null) {
        result.size(limit);
    }

    // todo - add ordering
    Terms.Order order = Terms.Order.count(false);
    Sort sort = Coerce.to(aggregation.get("order"), Sort.class, null);
    if (sort != null) {
        boolean asc = Sort.Direction.Ascending.equals(sort.getDirection());
        if (Sort.Type.Count.equals(sort.getType())) {
            order = Terms.Order.count(asc);
        } else if (Sort.Type.Lexical.equals(sort.getType())) {
            order = Terms.Order.term(asc);
        }
    }
    result.order(order);

    addSubAggs(queryConverter, aggregation, result);
    return result;
}
 
开发者ID:scaleset,项目名称:scaleset-search,代码行数:30,代码来源:TermAggregationConverter.java

示例5: getFacetBuilder

import org.elasticsearch.search.aggregations.bucket.terms.TermsBuilder; //导入方法依赖的package包/类
public static AggregationBuilder getFacetBuilder(MultiValueFacet multiValueFacet) {
    FacetConfiguration facetConfiguration = multiValueFacet.getFacetConfiguration();
    JSONObject facetData = facetConfiguration.getData();

    if (multiValueFacet.isStatic()) {
        return null;
    }
    TermsBuilder termsFacetBuilder = AggregationBuilders.terms(facetConfiguration.getFieldName());
    if (facetData.has("maxTerms")) {
        termsFacetBuilder.size(facetData.getInt("maxTerms"));
    }
    termsFacetBuilder.field(facetConfiguration.getFieldName());
    return termsFacetBuilder;
}
 
开发者ID:R-Knowsys,项目名称:elasticray,代码行数:15,代码来源:LiferayFacetParser.java


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