Elastic search " settings " add in Python module -


how following settings can add python elastic search module. please provide example. have created indexes , mappings. stuck settings.

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"            ]         }      }   }  }, 

you can use elasticsearch.indices.create , pass settings body.

docs says:

create(*args, **kwargs)

create index in elasticsearch. http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html

parameters:

  • index – name of index
  • body – configuration index (settings , mappings)
  • master_timeout – specify timeout connection master
  • timeout – explicit operation timeout

so can pass body settings argument.


Comments

Popular posts from this blog

c++ - OpenMP unpredictable overhead -

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

javascript - Wordpress slider, not displayed 100% width -