我尝试通过 bash 脚本执行此命令,但出现以下错误:
#!/bin/bash
curl -XPOST 'localhost:9200/my_index/_close'
curl -XPUT 'localhost:9200/my_index/_settings' -d '{
"analysis": {
"analyzer": {
"ar_analyzer": {
"tokenizer": "standard",
"filter" : ["standard", "lowercase", "synonym", "ar_stemmer"]
},
"fr_analyzer": {
"tokenizer": "standard",
"filter" : ["standard", "lowercase", "synonym", "fr_stemmer"]
}
},
"filter" : {
"ar_stemmer" : {
"type" : "stemmer",
"name" : "arabic"
},
"fr_stemmer" : {
"type" : "stemmer",
"name" : "french"
},
"synonym" : {
"type" : "synonym",
"synonyms_path" : "synonyms.txt"
}
}
}
}'
curl -XPOST 'localhost:9200/my_index/_open'
错误堆栈跟踪:
{"error":"IndexPrimaryShardNotAllocatedException[[my_index] 主未分配 post api]","status":409}{"error":"ElasticSearchIllegalArgumentException[无法更新非动态设置[[index.analysis.filter.ar_stemmer.名称,index.analysis.analyzer.fr_analyzer.filter.3,index.analysis.filter.synonym.type,index.analysis.analyzer.ar_analyzer.filter.0,index.analysis.analyzer.fr_analyzer.filter.0,索引。 analysis.analyzer.ar_analyzer.filter.1,index.analysis.analyzer.fr_analyzer.filter.2,index.analysis.analyzer.fr_analyzer.filter.1,index.analysis.analyzer.ar_analyzer.filter.2,index.analysis。 Analyzer.ar_analyzer.filter.3,index.analysis.filter.ar_stemmer.type,index.analysis.filter.fr_stemmer.name,index.analysis.analyzer.ar_analyzer.tokenizer,index.analysis。filter.fr_stemmer.type, index.analysis.analyzer.fr_analyzer.tokenizer, index.analysis.filter.synonym.synonyms_path]] 用于开放索引[[my_index]]]","status":400}