美文网首页
Text fields are not optimised fo

Text fields are not optimised fo

作者: 觉释 | 来源:发表于2020-10-15 11:36 被阅读0次

报错

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
}
}
}

相关文章

网友评论

      本文标题:Text fields are not optimised fo

      本文链接:https://www.haomeiwen.com/subject/gjgupktx.html