1
votes

We have a specific requirement of sorting the products as per a specific attribute value sequence. Any pointer or source of info would help us.

Example of the scenario;

Let's say for search result I want to sort results based on a attribute producttype. Where producttype has following values:

A, B, C, D

so while in Solr query I can give either producttype asc, producttype desc.

But I want get result in a specific way by saying first give me All results of values 'C' then B, A, D.

We are using Solr with IBM wcs7.

1

1 Answers

2
votes

I recommend you to take a look on this article - http://sujitpal.blogspot.ru/2011/05/custom-sorting-in-solr-using-external.html or sorting by FunctionQuery - http://wiki.apache.org/solr/FunctionQuery#Sort_By_Function

UPD. Also, one possible solution is add term query with boosting, e.g.

*:* OR type:A^100 OR type:B^200 OR type:C^2

So, it will be boosted in needed way. All you need to do, is play with boosting weight a little bit