有没有办法可以向 Lucene.NET 提供预定义的相关术语列表?
我知道我可以在搜索过程中为术语指定“提升因子”,如 中所述http://lucene.apache.org/java/2_4_0/queryparsersyntax.html。
我的问题是:我可以为 Lucene 提供预定义的相关表吗?
例如,我可以说“椅子”和“桌子”是相关词,提升系数为 4,所有后续搜索都会尊重这一点。
I know I can, during search, specify a "boost factor" to a term as described in http://lucene.apache.org/java/2_4_0/queryparsersyntax.html.
My question is: Can I provide Lucene with a predefined table of relevance?
For instance, I could say that "chair" and "table" are relevant words with a boost factor of 4 and all subsequent searches would respect that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在索引时,您可以使用有效负载 - 请参阅 http: //www.lucidimagination.com/blog/2009/08/05/getting-started-with-payloads。您的特殊术语会使用有效负载进行编码,在查询时,可以对其进行解码并用于提供额外的提升。
或者,您可以扩展现有的 QueryParser 来为您的特殊术语提供额外的提升因子。
At index time you can use Payloads -- See http://www.lucidimagination.com/blog/2009/08/05/getting-started-with-payloads . Your special terms get encoded with a payload which, at query time, can be decoded and used to give an extra boost.
Alternatively, you might be able to extend the existing QueryParser to give your special terms an extra boost factor.