我在试图获得“阿斯奇折叠“为我的 Rails 应用程序工作。
我想搜索包含“的单词accented“例如我想要的字符”foróige“当我搜索时出现”foroige”。
我已经尝试了很多事情。下面是其中的一些。
analysis: {
analyzer: {
text: {
tokenizer: "standard",
filter: ["standard","lowercase", "asciifolding"],
char_filter: 'html_strip'
},
sortable: {
tokenizer: "keyword",
filter: ["lowercase", "asciifolding"],
char_filter: 'html_strip'
}
}
}
我还通过遵循 James Healey charmap for sphinx 的重音字符尝试了 char_filter 。http://yob.id.au/2008/05/08/thinking-sphinx-and-unicode.html http://yob.id.au/2008/05/08/thinking-sphinx-and-unicode.html
非常感谢任何帮助。
经过一番尝试后,我解决了这个问题。我必须改变默认分析器的行为。
analyzer: {
default: {
tokenizer: "standard",
filter: ["standard", "lowercase", "asciifolding"]
},
text: {
tokenizer: "standard",
filter: ["standard", "lowercase"],
char_filter: 'html_strip'
},
sortable: {
tokenizer: "keyword",
filter: ["lowercase"],
char_filter: 'html_strip'
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)