如何使用 Python ElasticSearch 客户端设置索引设置

你可以使用官方 ElasticSearch python 客户端库通过以下方式设置索引设置:

es_put_settings.py
es.indices.put_settings(index="my-index", body={
    # 在此放置你的索引设置
    # Example: "index.mapping.total_fields.limit": 100000
})

完整示例:

es_put_settings_full_example.py
from elasticsearch import Elasticsearch

es = Elasticsearch()

es.indices.put_settings(index="ways", body={
    "index.mapping.total_fields.limit": 100000
})

Check out similar posts by category: Databases, ElasticSearch, Python