here is the data in my elasticsearch server:
{"system": "aaa"},
{"system": "bbb"},
{"system": null}
I want to get the statistics for system. then I did the query:
{
"aggs" : {
"myAggrs" : {
"terms" : { "field" : "system" }
}
}
it gives me the result:
{
"key": "aaa",
"doc_count": 1
},
{
"key": "bbb",
"doc_count": 1
}
but the "key" : null is not included in the result, how can I get it?
here is my expect result:
{
"key": "aaa",
"doc_count": 1
},
{
"key": "bbb",
"doc_count": 1
},
{
"key": null,
"doc_count": 1
}