我想为索引配置synonym
;通过Elasticvue
,我运行这个:
HTTP method : PUT , Path : /my_index
Request body :
{
"settings": {
"index": {
"analysis": {
"analyzer": {
"synonym": {
"tokenizer": "whitespace",
"filter": [
"synonym"
]
}
},
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "synonym.txt"
}
}
}
}
}
}
结果:
{
"error": {
"root_cause": [
{
"type": "resource_already_exists_exception",
"reason": "index [my_index/F5AydksvQy2hzXNV1BnyWg] already exists",
"index_uuid": "F5AydksvQy2hzXNV1BnyWg",
"index": "my_index"
}
],
"type": "resource_already_exists_exception",
"reason": "index [my_index/F5AydksvQy2hzXNV1BnyWg] already exists",
"index_uuid": "F5AydksvQy2hzXNV1BnyWg",
"index": "my_index"
},
"status": 400
}
那么如何解决这个问题呢?
您首先需要删除索引,然后使用新的索引设置重新创建索引。
您收到错误resource_already_exists_exception
,因为您试图在旧索引仍然存在的情况下创建索引。