Elasticsearch“设置”在Python模块中添加

use*_*375 2 python search elasticsearch

如何将以下设置添加到 python elastic search 模块。请举个例子。我已经创建了索引和映射。但我被设置困住了。

curl -XPUT "http://localhost:9200/blurays " -d'
{
   "settings": {
     "analysis": {
     "filter": {
        "nGram_filter": {
           "type": "nGram",
           "min_gram": 2,
           "max_gram": 20,
           "token_chars": [
              "letter",
              "digit",
              "punctuation",
              "symbol"
           ]
        }
     },
     "analyzer": {
        "nGram_analyzer": {
           "type": "custom",
           "tokenizer": "whitespace",
           "filter": [
              "lowercase",
              "asciifolding",
              "nGram_filter"
           ]
        },
        "whitespace_analyzer": {
           "type": "custom",
           "tokenizer": "whitespace",
           "filter": [
              "lowercase",
              "asciifolding"
           ]
        }
     }
  }
 },
Run Code Online (Sandbox Code Playgroud)

KSR*_*KSR 6

如果您的索引已存在,您可以使用 更新其设置elasticsearch.indices.put_settings