(HibernateSearch) MultiFieldQueryParser 每个字段不同的分析器
我的一些索引字段使用希腊语分析器,我想对其他一些字段使用英语分析器。我的问题是:搜索结果时(当前使用 MultiFieldQueryParser),如何为每个字段使用不同的分析器,以便希腊语分析器用于希腊语索引字段,英语分析器用于英语索引字段?
Some of my indexed fields use a Greek analyzer and I want to use an English analyzer for some other fields. My problem is: When searching for results (with a MultiFieldQueryParser currently), how can I use a different analyzer per field, so that a Greek analyzer is used for Greek-indexed fields and an English analyzer is used for English-indexed fields?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是我找到的解决方案。请评论。
Here is the solution I found. Please comment.
您可以像这样构建查询解析器:
它将使用正确的分析器,如 Item 类的注释中所定义:
You could build your query parser like this:
which would use the proper analyzer, as defined in the annotations of your Item class: