Restrict ElasticSearch aggregation by type? -
how perform elasticsearch aggregation specific type? realize can specify index and/or type in request url, want perform aggregations on 2 distinct types.
thank you!
you filter aggregation type, , use sub-aggregations. example:
{ "aggs": { "test 1": { "filter": { "type": { "value": "type1" } }, "aggs": { "agg_name": { "terms": { "field": "field1", "size": 10 } } } }, "test 2": { "filter": { "type": { "value": "type2" } }, "aggs": { "agg_name": { "terms": { "field": "field2", "size": 10 } } } } } }
Comments
Post a Comment