Solr 搜索、数字匹配和相关性
我将从用例开始。假设我正在搜索价格为 500 美元的产品。我不一定介意它的成本是否稍高或稍低,但我希望该价格范围内的产品获得更高的总体相关性得分。
Solr 有什么办法可以做到这一点吗?我在网站上看到的相关性/MoreLikeThis 文档似乎没有任何偏离给定数字的概念。
相关问题。我希望能够修改我的 solr 搜索权重来实现这两个查询:
“查找价格相似的相机” 和 “查找类似功能的摄像机”
看起来更像这个处理程序,用于计算相关性的算法看起来并不像向程序员公开任何控制旋钮。例如,对于价格相似的相机,我想修改相关性分数,以便我们增加相同价格范围内项目的相关性,但仍然保持功能的权重。对于类似特征,这将相反。 IE“找到类似功能的相机,但如果一台售价四万美元,它的相关性就不如我选择的价格的类似相机”(它应该有更多功能,但也许他们只是在镜头盖上放了镀铬旋转器)。
I'll just start with the use case. Say I'm searching for a product with a price of $500. I don't necessarily mind if it costs slightly more, or slightly less, but I want products in that price range to receive a higher overall relevance score.
Is there any way to do this in Solr? The relevance/MoreLikeThis docs I've seen on the site don't seem to have any concept of deviation from a given number.
Related question. I'd like to be able to modify my solr search weighting to achieve these two queries:
"Find similarly priced cameras"
and
"Find similarly featured cameras"
Looking at the more like this handler, the algorithm used to compute the relevance doesn't look like it exposes any control knobs to the programmer. For the similarly priced cameras for example, I'd like to modify the relevance score so that we increase the relevances of items in the same price bracket, but still maintain a weighting for features. For similarly featured, the this would be reversed. I.E "find similarly featured cameras, but if one costs forty thousand dollars, it is less relevant than a similar camera at my selected price" (it should have more features, but maybe they just put chrome spinners on the lens cap).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Solr Wiki 上,您将看到一些示例,说明如何使用按范围搜索
field:[a TO b]
语法。您可能希望将其与排序结合起来。您还可以构造一个 Solr SearchComponent 来指定价格范围的权重,或者 < a href="http://wiki.apache.org/solr/SolrRequestHandler" rel="nofollow noreferrer">RequestHandler。请求处理程序是我更熟悉的。 “qf”字段的示例可能是:
我希望这可以帮助您开始。
On Solr Wiki, you'll see some examples of how you can search by range using the
field:[a TO b]
syntax.You would want to couple this with sorting. You could also construct a Solr SearchComponent that could specify a weight for a price range, or a RequestHandler. A request handler is what I was more familiar with. An example 'qf' field might be:
I hope this can get you started.