此限制已在以下 GitHub 中介绍issue.
命令计数grep type | wc -l
计算文本的行数"type"。因此我认为计数有可能不准确。我做了一个小文本,得到的值比实际字段数更高。所以你得到的字段数量也可能少于实际数量,但我还想不出一个场景。
这是我做的测试。
curl -s -XGET http://localhost:9200/stackoverflow/_mapping?pretty
{
"stackoverflow" : {
"mappings" : {
"os" : {
"properties" : {
"NAME" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"TITLE" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
},
"fielddata" : true
},
"title" : {
"type" : "text",
"fielddata" : true
}
}
}
}
}
}
自从"type"是否有 5 行,即使我只有 3 个字段,我得到的输出却是 5。
Can you 尝试增加限制看看它是否有效?
PUT my_index/_settings
{
"index.mapping.total_fields.limit": 2000
}
您还可以在创建索引期间增加此限制。
PUT my_index
{
"settings": {
"index.mapping.total_fields.limit": 2000,
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
...
}
}
学分:https://discuss.elastic.co/t/total-fields-limit-setting/53004/2