搜索+聚合
过滤+聚合测试
GET /tvs/sales/_search { "size": 0, "query": { "constant_score": { "filter": { "range": { "price": { "gte": 1200, "lte":1000000 } } } } }, "aggs": { "avg_price": { "avg": { "field": "price" } } } } |
过滤+聚合测试结果
{ "took": 12, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 7, "max_score": 0, "hits": [] }, "aggregations": { "avg_price": { "value": 2885.714285714286 } } } |