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

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -