Elasticsearch实战 | term: xxx was completely eliminated by analyzer

Elasticsearch实战 | term: xxx was completely eliminated by analyzer

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. 解决

常规的中文词 网约车 不属于特殊字符,我这里是配置了停止词 网约车 导致。删除停止词库中的“网约车”或者去除对应的同义词皆可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值