如何向 SOLR SE 添加更多同义词?
我的应用程序与医疗保健相关,因此我希望使用“heart”的查询也能带来包含“cardiac”的结果
这只是一个例子,我还有更多同义词需要加载。
如何向 SOLR 传授这些同义词?
My application is related to health care, so I would like to have queries that use "heart" to also bring results that include "cardiac"
That is just an example, I have many more synonyms I need to load.
How does SOLR can be taught about those synonyms?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅 SOLR 文档,您需要在架构中的字段上创建 SynonymFilter,然后定义 synonyms.txt 文件来定义所有同义词,文件的格式在文档中最详细,因此我不会去进入这里。
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
See the SOLR documentation, you'll want to create a SynonymFilter on a Field in your schema, and then define a synonyms.txt file to define all your synonyms, formatting of the file is detailed best in the docs so I won't go into it here.
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters