报错
org.elasticsearch.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 [idtest] in order to load field data by uninverting the inverted index. Note that this can use significant memory.]
解决方案
在[idtest]上设置fielddata=true,以便通过取消反转索引来加载字段数据
请注意,这可能会占用大量内存
POST /test_index/_mapping
{
"properties": {
"idtest": {
"type": "text",
"fielddata": true
}
}
}











网友评论