Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 544 Bytes

aggregations.md

File metadata and controls

21 lines (13 loc) · 544 Bytes

Aggregations

聚合

Elasticsearch提供完整的Java API来使用聚合。 请参阅聚合指南

使用 AggregationBuilders 构建对象,增加到搜索请求中:

import org.elasticsearch.search.aggregations.AggregationBuilders;

SearchResponse sr = node.client().prepareSearch()
        .setQuery( /* your query */ )
        .addAggregation( /* add an aggregation */ )
        .execute().actionGet();