Krunal Krunal - 1 year ago 175
Javascript Question

Price Range Filter with Slider UI with Min & Max value from Solr in same query?

I'm working on an Solr integration for an e-commerce site. I want to offer a jQuery Slide Range UI (refer

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?

Answer Source

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 :


Read here about it :

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download