2017-04-26 62 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

回答