扩展字符(欧洲)到美国ascii搜索索引 [英] Extended characters (european) to US ascii for search indexing

查看:216
本文介绍了扩展字符(欧洲)到美国ascii搜索索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个表或启发式库,可以将扩展字符(如o与上面的帽子)转换为正规ascii o。

I'm looking for a table or heuristic library that can convert extended characters like the o with the hat above it to a regular ascii o.

我希望这样做的搜索索引的目的,因为大多数人不打算用帽子键入o。

I'm looking to do this for search indexing purposes since most people are not going to type the o with the hat.

例如,我在搜索中键入Cote,但我希望我的搜索包括Côte。

For example I type "Cote" into the search but I want my search to include things like "Côte".

看来Solr不会转换这些。
我试过java.text.Normalizer和朋友,但是没有工作。确实工作见下面的解决方案。

It appears Solr does not convert these. I tried java.text.Normalizer and friends but that did not work. did work see solution below.

推荐答案

您要使用 ASCIIFoldingFilterFactory 在Solr中执行索引和查询分析时。如果你想要这个独立的你可以抓住源代码,并做任何它做。

You want to use the ASCIIFoldingFilterFactory when performing your indexing and query analysis in Solr. If you want this standalone you could just grab the source code and does whatever it does.

这篇关于扩展字符(欧洲)到美国ascii搜索索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆