I have the following structure GET /index-*/_mapping
:
"top_field" : {
"properties" : {
"dict_key1" : {
"properties" : {
"field1" : {...},
"field2" : {...},
"field3" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"field4" : {...}
},
"dict_key2" : {
"properties" : {
"field1" : {...},
"field2" : {...},
"field3" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"field4" : {...}
},
"dict_key3": ...
}
In other words, top_field
stores a json.
I would like to aggregate over 'field3.keyword'
regardless of dict_key*
. Something like top_field.*.field3.keyword
.
However, I can't get it to work using terms aggregation, with or without nested. I also tried to just to bucket by the different dict_key*
, which would be almost as good, but I can't get this to work either.
How can I do this?