Es basic - zhongjiajie/zhongjiajie.github.com GitHub Wiki
-
聚合多组数据的时候可以在同一个aggs下面
POST index/_search { "aggs": { "agg_terms": { "terms": { "field": "field_one" } }, "agg_sum": { "sum": { "field": "field_two" } } } }
-
在mapping中加入aliases
PUT index_name { "settings" : { "number_of_shards": 3, "number_of_replicas": 2 }, "mapping": { "_doc": { "properties": { "field": { "type": "text" }, "field": { "type": "keyword" } } } }, "aliases" : { "my_alias1" : {}, "my_alias2" : {} } }
filters aggregation可以实现对类似条件的多次聚合filters aggregation