I have the following mapping for an aggregation field:
"language" : {
"type" : "string",
"index": "analyzed",
"analyzer" : "standard"
}
The value of a sample document in this property may look like: "en zh_CN"
This property has no other use except aggregation. I notice that when I get aggregation results on this property:
{
"query": {
"filtered" : {
"query": {
"match_all": {}
},
"filter" : {
...
}
}
},
"aggregations": {
"facets": {
"terms": {
"field": "language"
}
}
}
}
The bucket key values are in lower case.
"aggregations" : {
"facets" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [ {
"key" : "zh_cn",
"doc_count" : 2
}, {
"key" : "en",
"doc_count" : 1
} ]
}
}
How can I achieve my aggregation goal without letting ES to lowers the case of its values. I feel that I may need to change the mapping for this property, but not sure how.
Thanks and regards.