我试图让用户提交的查询“Joe Frankle”、“Joe Frankle”、“Joe Frankle's”以匹配原始文本“Joe Frankle's”。现在我们正在索引这个文本所在的字段(轮胎/红宝石格式):
{ :type => 'string', :analyzer => 'snowball' }
并搜索:
query { string downcased_query, :default_operator => 'AND' }
我试过这个不成功:
create :settings => {
:analysis => {
:char_filter => {
:remove_accents => {
:type => "mapping",
:mappings => ["`=>", "'=>"]
}
},
:analyzer => {
:myanalyzer => {
:type => 'custom',
:tokenizer => 'standard',
:char_filter => ['remove_accents'],
:filter => ['standard', 'lowercase', 'stop', 'snowball', 'ngram']
}
},
:default => {
:type => 'myanalyzer'
}
}
},