Reputation: 3277
I'm using Solr for offering faceted navigation for e-commerce site. However I need to define the custom order for facets, but I didn't find how to do that in Solr.
Any idea how to do this? I'm using Solr Net and latest version of Solr.
Here is an example what I need to do.
Current Facets
Operating System
Price
Note that it is just an example. And have many other facets. I want to display Price as the first facet, so need to order this facet field as well as facet options like this.
Price
Operating System
So here is how I need to order it:
Pls advise.
Upvotes: 7
Views: 15645
Reputation: 52809
You can use facet sort per field to order the different facets respectively.
e.g. f.<field_name>.facet.sort=count|index
Solr only provided two options Count and Index sort. Anything else needs to implemented through custom solutions or workarounds.
Upvotes: 9
Reputation: 4284
You can only sort by predefined criteria.
facet.sort
is what you use and it can only be:
- count - sort the constraints by count (highest count first)
- index - to return the constraints sorted in their index order (lexicographic by indexed term). For terms in the ascii range, this will be alphabetically sorted.
Have a look at this: http://wiki.apache.org/solr/SimpleFacetParameters#facet.sort
Upvotes: 0