當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。