我正在尝试在我的弹性搜索索引中添加analyzer
和,但出现此错误;mapping
[Error: MapperParsingException[mapping [product]]; nested: MapperParsingException[Analyzer [synonym] not found for field [name]];
我的索引名称产品和类型 product.my 设置 -
{
"settings": {
"products": {
"analysis":{
"analyzer":{
"synonym":{
"tokenizer": "my_ngram",
"filter":[
"synonym"
]
}
},
"tokenizer" : {
"my_ngram" : {
"type" : "nGram",
"min_gram" : "2",
"max_gram" : "3",
"token_chars": [ "letter", "digit" ]
}
},
"filter":{
"synonym": {
"type": "synonym",
"synonyms_path": "synonyms.txt",
"ignore_case": "true"
}
}
}
}
},
"mappings":{
"product":{
"_all":{
"enabled": true,
},
"properties":{
"name":{
"type": "string",
"index": "analyzed",
"analyzer": "synonym"
}
}
}
}
}
我正在使用最新版本的弹性搜索。