Showing a price range selector for visitor to narrow down search is a common use case for eCommerce sites. Usually developers try to use facets for this purpose which is not a correct way to do it. Facts for price should only be used if we need to break prices in to multiple ranges for selection like 1 to 100, 101 to 500 and 501 to more. For getting just the minimum and maximum price one must use the “stats” feature which is enabled by default in Solr. This can be achieved by providing additional parameters “stats=true&stats.field=price ” in request. Here the “price” is the numeric field in the index, you can change it as per your index/core. So the response from sample request like localhost:8983/solr/products/select?q=*:*&stats=true&stats.field=price&indent=true&wt=json response will include information for stats as


Here you can see the “min” and “max” values along other stats like “sum”, “mean” etc. Full documentation for this feature can be found here.