Reputation: 57
How the following settings can be add to python elastic search module. Please provide a example. I have created indexes and mappings. But I am stuck with 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"
]
}
}
}
},
Upvotes: 2
Views: 5084
Reputation: 231
If your index already exists, you can update its settings with elasticsearch.indices.put_settings
.
Upvotes: 6
Reputation: 21315
You can use elasticsearch.indices.create
and pass the settings as body.
Docs says:
create(*args, **kwargs)
Create an index in Elasticsearch. http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html
Parameters:
So you can pass body
with settings argument.
Upvotes: 2