Solr - 如何获得价格的模糊结果?

发布于 2025-01-08 03:46:27 字数 276 浏览 1 评论 0原文

在我的数据中,我有两个字段:类别和价格。我希望能够查询范围、价格:[500 TO 1000] 和类别:电子产品,但仍然返回低于 500 和超过 1000 的结果,只是根据范围的差异让它们在相关性上得分较低。

即我想显示:

product1 $500
产品2 550 美元
产品3 $650
产品4 900 美元
产品5 450 美元
产品6 475 美元
产品7 $1200

有人可以解释一下如何实现这一点吗?

谢谢, 德鲁

In my data, I have two fields, category and price. I would like to be able to query on a range, price:[500 TO 1000] and category:Electronics, but still return results under 500 and over 1000, just have them scored lower on relevancy based on the difference from the range.

i.e. I'd like to show:

product1 $500

product2 $550

product3 $650

product4 $900

product5 $450

product6 $475

product7 $1200

Can someone please shed some light on how this might be accomplished?

Thanks,
Drew

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

野味少女 2025-01-15 03:46:27

您可以尝试使用 edismax 查询解析器和 提升查询 将价格范围提升到高于其他查询。

bq=price:[500 TO 1000]^10

这将使该范围内的所有价格都高于其他价格,从而使它们名列前茅。

Can you try using edismax query parser and boost query to boost the price range higher than the others.

bq=price:[500 TO 1000]^10

This would boost all the prices within the range higher than the other to bring them on top.

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