ruby-on-rails-3.2 – Asciifolding不工作Elastic Search Rails

前端之家收集整理的这篇文章主要介绍了ruby-on-rails-3.2 – Asciifolding不工作Elastic Search Rails前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在努力让“asciifolding”为我的Rails应用程序工作.
我想搜索包含“重音”字符的单词,例如我想在搜索“foroige”时出现“foróige”.
我尝试了很多东西.下面有几个.
analysis: {
                analyzer: {
                    text: {
                        tokenizer: "standard",filter: ["standard","lowercase","asciifolding"],char_filter: 'html_strip'
                    },sortable: {
                        tokenizer: "keyword",filter: ["lowercase",char_filter: 'html_strip'
                    }
                }
           }

我也尝试过char_filter跟随James Healey charmap为狮身人面像加入重音字符.
http://yob.id.au/2008/05/08/thinking-sphinx-and-unicode.html

任何帮助都非常感谢.

解决方法

在玩完之后我解决了这个问题.我不得不改变默认分析器的行为.
analyzer: {
                    default: {
                        tokenizer: "standard","asciifolding"]
                    },text: {
                        tokenizer: "standard","lowercase"],filter: ["lowercase"],char_filter: 'html_strip'
                    }
                }
原文链接:https://www.f2er.com/ruby/265063.html

猜你在找的Ruby相关文章