You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Oliver Schihin <ol...@unibas.ch> on 2013/03/06 10:31:09 UTC

facet.sort-Problem in 4.0

Hello

Our application (VuFind, a library discovery tool) is speaking to a solr 3.5 index per 
default. To get the facet values back, the param 'facet.sort' is sent in the request with 
an empty value. Solr then delivers the called facets sorted by count, as it should be. A 
request looks (simplified) like this:
http://[host:port]/solr/[core]/select/?q=*:*&rows=10&fl=*,score&start=0&facet=true&facet.mincount=1&facet.limit=30&facet.sort=&facet.field=authorStr&wt=xml

We switched from solr 3.5 to solr 4.1 and discovered that the request built by our 
application yields an undesired result, facets are sorted by index. This is the behaviour:
* facet.sort=  //with the empty value, facets are sorted by index
* facet.sort=count|index //obviously, facets are sorted as told
* no facet.sort parameter //facets are sorted by count, as the default should be

A quick test on a solr 4.0 instance shows that the behaviour is still backward compatible 
with 3.5. An empty value delivers standard sorting by count, a non-existing parameter as well.

Short: 4.1 is not backwards compatible to 3.5 and to 4.0 with regard to facet sorting.

We suspect this has to do with the change from boolean to string in the setFacetSort Method:
http://lucene.apache.org/solr/api-4_0_0-BETA/org/apache/solr/client/solrj/SolrQuery.html#setFacetSort%28java.lang.String%29

Questions are:
* Is this known? I guess so
* Is there a way to fix this on the solr side?
* What are the reasons behind the change?

If not, we obviously should to this in the client app.

Regards
Oliver