Lucene.NET 上的 ASCIIFoldingFilter 使用示例
我正在尝试在Lucene.NET上实现我的搜索,我的需求是:
- 搜索并直接找到结果
- ,如果没有结果,使用Accent Insensitive再次搜索
我在SQL Server上完成了它,但我想将其移动到Lucene.NET。我做了研究,首先在Lucene中找到了ISOLatinFilter,然后找到了ASCIIFoldingFilter。但我找不到如何使用它的简单示例(即使在 Lucene in Action 书中)
您能给我一个小示例代码来实现重音不敏感搜索吗?我还需要更改索引方面的其他内容吗?由于我还需要区分重音,因此我无法仅创建不区分重音的索引。
谢谢
I am trying to implement my search on Lucene.NET and my needs are:
- search and find the result directly
- if there is no result, search again with Accent Insensitive
I did it on SQL Server but I want to move it to Lucene.NET. I made a research and first I found ISOLatinFilter and then ASCIIFoldingFilter in Lucene. But I couldn't find a simple example how to use it (Even in Lucene in Action book)
Can you please give me a small sample code to achieve accent insensitive search? Do I need to change anything else on Indexing? As I need accent sensitive also, I cannot create an Accent insensitive index only.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用此类作为索引和搜索的分析器,对我有用。
Use this class as your Analyzer on index and search, Works for me.