如何将以下设置添加到 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"
]
}
}
}
},
最佳答案
如果您的索引已存在,您可以使用 elasticsearch.indices.put_settings
更新其设置.
关于python - Elasticsearch "settings "添加Python模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27242679/