Caused by: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [age] in order to load field data by uninverting the inverted index. Note that this can use significant memory.]]
对age排序但是age的类型为 text
PUT user/_mapping
{
"properties":{
"age":{
"type":"text",
"fielddata":true
}
}
}
这种解决方案会占用很多内存



