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
相关产品推荐
相关产品推荐

