I’m searching for products in my catalog using Solr.
I wanted to know how can I give a higher score for products with higher prices?
this is the request that I’m sending:
http://localhost:8080/solr/collection1/query?q=iphone&rows=4&fq=price:[*+TO+500]
I’m getting many iPhone cases, so I want to flow up results with higher prices (To get the iPhone cellular machine), or if its possible to show 1 result for price range 0 – 50, another one for 50 – 100 etc. and that way I will be able to show few products from few categories.
To show 1 result for each price range, use Solr Grouping.
You can use a query like,
If you want you can also set group.main=true as a parameter to get response in the normal format.
You can use ‘group.limit’ parameter to limit number of results in each group.
You also have the privilege to sort within the group using ‘group.sort’ parameter, in case, you need more than one result from each group in sorted order.