设置mapping的时候需要设置fielddata 为true
PUT my_index/_mapping/my_type
{
"properties": {
"my_field": {
"type": "text",
"fielddata": true
}
}
}
{
"properties": {
"my_field": {
"type": "text",
"fielddata": true
}
}
}
本文介绍如何在Elasticsearch中设置mapping时开启fielddata功能,以便支持高效的聚合和排序操作。通过一个具体例子展示了如何指定字段类型并启用fielddata。

被折叠的 条评论
为什么被折叠?