价格范围过滤器,带有滑块UI,带有Min& Solr在同一个查询中的最大值? [英] Price Range Filter with Slider UI with Min & Max value from Solr in same query?

查看:82
本文介绍了价格范围过滤器,带有滑块UI,带有Min& Solr在同一个查询中的最大值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为电子商务网站开展Solr集成。我想提供一个jQuery Slide Range UI(请参阅 http://jqueryui.com/slider/#range)。



因此,访问者将获得一个页面上具有最小和最大价格的滑块,用于定义范围并相应地应用过滤器。 / p>

在Solr方面,我了解如何对此进行范围过滤查询。



然而,为了显示范围,我需要最小和最大价格值。我不确定如何从Solr获得这个。



此外,当其他方面被过滤时,我需要更改此min&最高价格。但我无法思考Solr如何做到这一点。 solr是否提供min&同一查询中的最高价格值?



如何做?



或者最佳做法是什么?用Solr实现这个?

解决方案

我相信你已经获得了当前数据集的方面值,
所以对于您的范围问题,您必须在客户端对facet值进行排序并提供min&滑块的最大值。



这样它也可以解决您的其他问题,因为应用过滤器后,返回的构面值也会发生变化。



此外,如果facet没有返回任何内容,您可以添加额外的检查,以便不显示滑块。



对于大数据范围,我认为你可以使用solr stats 例如:

  http:// localhost:8983 / solr / select?q = *:*& stats = true& stats.field = price& rows = 0& indent = on 

在此处阅读: http://wiki.apache.org/solr/StatsComponent


I'm working on an Solr integration for an e-commerce site. I want to offer a jQuery Slide Range UI (refer http://jqueryui.com/slider/#range).

So visitor will be offered with a slider with min and max price on the page which they can use to define a range and accordingly the filter is applied.

On Solr side, I understand how to make a range filter query on this.

However, for displaying a range I need min and max price value. I'm not sure how to get this from Solr.

Moreover, when other facets are filtered, I need to change this min & max price. But I can not think about how this can be done with Solr. Does solr provide min & max price value in the same query?

How to do this?

Or what is the best practices to implement this with Solr?

解决方案

I believe you are already getting the facet values of current data set, so as for your range problem you have to sort the facet value on the client side and supply the min & max values to slider.

This way it resolves your other problem too, because with filters applied, the returned resultant values for facets will change too.

Moreover you can add an additional check for not showing sliders in case facets does n't return anything.

For large data ranges , i think you can use solr stats eg :

http://localhost:8983/solr/select?q=*:*&stats=true&stats.field=price&rows=0&indent=on

Read here about it : http://wiki.apache.org/solr/StatsComponent

这篇关于价格范围过滤器,带有滑块UI,带有Min& Solr在同一个查询中的最大值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆