
[why] By default, fields can be added dynamically to a document, or to inner objects within a document, just by indexing a document containing the new field. However, there are many fields that we do not need, and "Limit of total fields [1000] in index [jobs] has been exceeded" exception will be reported when the number of fields exceeds 1000. [how] Disable default dynamic mapping. Signed-off-by: Zhang Yuhang <zhangyuhang25@huawei.com> --- sbin/es-jobs-mapping.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sbin/es-jobs-mapping.sh b/sbin/es-jobs-mapping.sh index 9d420f7..076bdd3 100755 --- a/sbin/es-jobs-mapping.sh +++ b/sbin/es-jobs-mapping.sh @@ -38,6 +38,7 @@ else curl -H 'Content-Type: Application/json' -XPUT 'http://localhost:9200/jobs' -d '{ "mappings": { "_doc": { + "dynamic": false, "dynamic_templates": [ { "pp": { @@ -61,6 +62,10 @@ else } ], "properties": { + "pp": { + "dynamic": true, + "properties": {} + }, "suite": { "type": "keyword" }, -- 2.23.0