ElasticSearch基本操作-聚合操作

统计数据

GET /how2java/_search
{
  "size": 0,
  "aggs": {
    "group_by_place": {
      "terms": {
        "field": "place.keyword",
        "size": 3
      }
    }
  }
}

//相当于sql语句
select count(*),place from product group by place limit 0,3  

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(ElasticSearch,elasticsearch,sql,java)