Asciifolding无法正常工作Elastic Search Rails

编程入门 行业动态 更新时间:2024-10-28 12:23:32
本文介绍了Asciifolding无法正常工作Elastic Search Rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在尝试为我的Rails应用程序使用 asciifolding 时遇到了非常困难的时期。 我想搜索包含 重音字符的单词,例如当我搜索 foroige 时我想出现 foróige 。 我尝试了很多事情。下面是其中的一些。

I am having a really bad time trying to get "asciifolding" working for my Rails app. I want to search words containing "accented" characters for example i want "foróige" to come up when i search "foroige". I have tried many things. A couple of them are below.

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的狮身人面像来重音字符来尝试char_filter。 yob.id.au /2008/05/08/thinking-sphinx-and-unicode.html

I have also tried char_filter by following James Healey charmap for sphinx for accented characters. yob.id.au/2008/05/08/thinking-sphinx-and-unicode.html

我们非常感谢您的帮助。

Any help is highly appreciated.

推荐答案

玩了之后,我解决了这个问题。我必须更改默认分析器的行为。

After playing around with it i resolved the issue. I had to change the behaviour of the default analyzer.

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' } }

更多推荐

Asciifolding无法正常工作Elastic Search Rails

本文发布于:2023-10-21 17:43:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1514923.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法正常   工作   Asciifolding   Rails   Search

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!