Solr - 如何获得价格的模糊结果?
在我的数据中,我有两个字段:类别和价格。我希望能够查询范围、价格:[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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试使用 edismax 查询解析器和 提升查询 将价格范围提升到高于其他查询。
这将使该范围内的所有价格都高于其他价格,从而使它们名列前茅。
Can you try using edismax query parser and boost query to boost the price range higher than the others.
This would boost all the prices within the range higher than the other to bring them on top.