: We having 100 category and each category having it own internal ranking. : Let consider if I search for any product and its fall under 30 categories : and we are showing top 10 categories in filter so that user can filter there : results.
the faceting solr provides out of the box is explicitly called "SimpleFaceting" because it's designed to handle the "simple" cases :) what you are describing is applying specific, subjective, business logic and isn't covered in the SimpleFacets implementation. if your category rankings never changed you can embed the ranking as part of the category name, and then tell solr not to sort the facets by count (ie: facet.sort=false) so 001_catZ will appear first, then 002_catM, etc... if your category rankings can/will change at arbitrary points in time, and you don't want to have to reindex, you'll need to do implement a custom Facet Component that knows about (how to find) your rankings. I've talked about something like this at CNET in two previous ApacheCon talks... http://people.apache.org/~hossman/apachecon2006us/ http://people.apache.org/~hossman/apachecon2008us/btb/ -Hoss