field is" AA", the result of the aggregate query is" how does aa", get the original value?
make the following query:
POST /113/_search
{
"query": {
"query_string": {
"query": "Jack"
}
},
"aggs" : {
"gender" : {
"terms" : {
"field" : "gender"
}
},
"grade" : {
"terms" : {
"field" : "grade",
"order" : {"_count" : "asc"}
}
}
}
}
get the result:
{
"hits": {
"total": 4,
"max_score": 1.3862944,
"hits": [
{
"_index": "113",
"_type": "default_type",
"_id": "1",
"_score": 0.07419574,
"_source": {
"name": "Tome Jack",
"grade": "AA",
"gender": 1
}
}
]
},
"aggregations": {
"grade": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "b",
"doc_count": 1
},
{
"key": "c",
"doc_count": 1
},
{
"key": "aa",
"doc_count": 2
}
]
}
}
}
The grade field is set as follows
"grade": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
},
"analyzer": "ik_max_word",
"fielddata": true
},
The value of the grade field has been changed in the aggregate query. How to get the original value?