1. 前言
本博文浅记一个小bug的解决
2. 详细报错
下面是创建某个索引时候的报错,该索引中配置了远程同义词(remote synonyms)。报错意思是不能识别333 行的网约车。其中Invalid synonym rule at line 333中的333指的是配置的远程同义词列表中的行号
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "failed to build synonyms"
}
],
"type": "illegal_argument_exception",
"reason": "failed to build synonyms",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "could not reload remote synonyms file to build synonyms",
"caused_by": {
"type": "parse_exception",
"reason": "Invalid synonym rule at line 333",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "term: 网约车 was completely eliminated by analyzer"
}
}
}
},
"status": 400
}
3. 解决
常规的中文词 网约车 不属于特殊字符,我这里是配置了停止词 网约车 导致。删除停止词库中的“网约车”或者去除对应的同义词皆可