2017-04-26 60 views
1

如何忽略文档和查询中的撇号?如何忽略ElasticSearch中的撇号

例如

文件:

{ 
    name: "Ch`iroki the Big Dud" 
} 

查询:

name match "Ch`irki" 

同时还获得结果中的原文和使用其他语言分析器。

我试着添加replace_pattern char_filter,但它没有工作。

EDIT

这是索引设置:

{ 
    "settings": { 
     "analysis": { 
      "char_filter": { 
       "replace_apostrophe": { 
        "type": "pattern_replace", 
        "pattern": "'", 
        "replacement": "" 
       } 
      } 
     } 
    } 
} 

这是_analyze请求:

{ 
    "char_filters": ["replace_apostrophe"], 
    "text": "a'b'c" 
} 

这是_analyze响应:

{ 
    "char_filters": ["replace_apostrophe"], 
    "text": "a'b'c" 
} 

我错在哪里?

+0

你能显示你的索引设置和映射吗? – Val

回答