我尝试通过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'
Run Code Online (Sandbox Code Playgroud)
错误堆栈跟踪:
{"error":"IndexPrimaryShardNotAllocatedException [[my_index] primary not allocated post api]","status":409} {"error":"ElasticSearchIllegalArgumentException [无法更新非动态设置[[index.analysis.filter.ar_stemmer. name,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,index. 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}
Waq*_*med 121
嗨,我正在使用这样的设置可能会帮助你:
curl -XPOST 'localhost:9200/lookupindex/_close'
Run Code Online (Sandbox Code Playgroud)
curl -XPUT 'localhost:9200/lookupindex/_settings' -d '{
"index": {
"analysis": {
"analyzer": {
"custom_standard_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase",
"asciifolding",
"customstopwords"
]
},
"phonetic_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"asciifolding",
"phoneticstopwords"
]
}
},
"filter": {
"customstopwords": {
"type": "stop",
"stopwords": [
"+",
".",
" ",
"ca",
"fl",
"bc",
"b.c",
"b.c.e",
"bce",
"act.c.",
"act",
"style",
"style of",
"attr.",
"attr",
"manner of",
"manner",
"circle of",
"circle",
"after",
"near",
"copy",
"copy after",
"imitator",
"school, copy",
"studio",
"studio of",
"Italian school",
"workshop of",
"workshop",
"16th",
"or",
"17th c.",
"late follower",
"follower of",
"follower",
"attributed",
"near",
"copy after painting",
"by or after",
"fake",
"and school",
"workshop-copy",
"counterproof",
"copy after drawing",
"copy of",
"school of",
"called",
"copy IBS",
"German School",
"placed with",
"attribution"
]
},
"phoneticstopwords": {
"type": "stop",
"stopwords": [
"+",
",",
"-",
".",
"ca",
"fl",
"bc",
"b.c",
"b.c.e",
"bce",
"act.c.",
"act",
"style",
"style of",
"attr.",
"attr",
"manner of",
"manner",
"circle of",
"circle",
"after",
"near",
"copy",
"copy after",
"imitator",
"school, copy",
"studio",
"studio of",
"Italian school",
"workshop of",
"workshop",
"16th",
"or",
"17th c.",
"late follower",
"follower of",
"follower",
"attributed",
"near",
"copy after painting",
"by or after",
"fake",
"and school",
"workshop-copy",
"counterproof",
"copy after drawing",
"copy of",
"school of",
"called",
"copy IBS",
"German School",
"placed with",
"attribution"
]
}
}
}
}
}
'
Run Code Online (Sandbox Code Playgroud)
curl -XPOST 'localhost:9200/lookupindex/_open'
Run Code Online (Sandbox Code Playgroud)
Mik*_*bov 10
我有类似的例外.你的榜样完整吗?你在关闭之前创建索引吗?
在我的情况下,它是如下:"创建索引,关闭它,添加设置,添加其他设置,添加映射,打开索引".索引创建后等待大约1秒修复了异常.
| 归档时间: |
|
| 查看次数: |
26914 次 |
| 最近记录: |