You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Elasticsearch stop token filter的ignore_case参数不生效问题排查

Elasticsearch 大小写不敏感停用词过滤器配置未生效

我测试Elasticsearch的大小写不敏感停用词过滤器时,直接采用官方文档示例配置,但配置未生效。仅小写停用词被过滤,像"The"、"IS"这类大写形式的停用词仍保留在分词结果中,且搜索这类词时仍能命中文档。

索引配置请求

PUT /my-index-000001
{
  "settings": {
    "analysis": {
      "analyzer": {
        "default": {
          "tokenizer": "whitespace",
          "filter": [ "my_custom_stop_words_filter" ]
        }
      },
      "filter": {
        "my_custom_stop_words_filter": {
          "type": "stop",
          "ignore_case": true
        }
      }
    }
  }
}

分词分析请求

GET my-index-000001/_analyze
{
  "field": "ASCII_FIELD", 
  "text" :"this that a b The is IS was açaí à la carte"
}

预期分词结果不应包含"The"和"IS",但实际它们仍存在,仅小写停用词被过滤。

添加测试文档

PUT my-index-000001/_doc/1
{    
  "ASCII_FIELD" :"this that a b The is IS was  açaí à la carte"
}

搜索请求

GET my-index-000001/_search
{
  "query": {
    "match": {
      "ASCII_FIELD": "The"
    }
  }
}

执行该搜索时,原本不应返回结果,但实际命中了添加的文档。


内容的提问来源于stack exchange,提问作者TAugusti

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.14 20:35:19