Solr 搜索、数字匹配和相关性

发布于 2024-08-18 03:07:38 字数 423 浏览 15 评论 0原文

我将从用例开始。假设我正在搜索价格为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑咖 2024-08-25 03:07:38

在 Solr Wiki 上,您将看到一些示例,说明如何使用按范围搜索 field:[a TO b] 语法。

您可能希望将其与排序结合起来。您还可以构造一个 Solr SearchComponent 来指定价格范围的权重,或者 < a href="http://wiki.apache.org/solr/SolrRequestHandler" rel="nofollow noreferrer">RequestHandler。请求处理程序是我更熟悉的。 “qf”字段的示例可能是:

<str name="qf">
    productname^1.0 price^2.0 brand^0.5
</str>

我希望这可以帮助您开始。

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:

<str name="qf">
    productname^1.0 price^2.0 brand^0.5
</str>

I hope this can get you started.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文