Search code examples
solrsolrj

Solrj ClientUtils toQueryString escapes facet.pivot field comma


The toQueryString method inside Solrj's ClientUtils class is called when the http request is formed internally. But in this process, it also encodes the commas (,) that need to be sent in the facet.pivot field.

eg . facet.pivot=A1,A2 gets sent as facet.pivot=A1%2CA2

Because of this the query returns no result.

Please suggest a mechanism to report this or any work around for the same.


Solution

  • Your question is about escaping/encoding the query for a solr request.

    In current version of solr the toQueryString method is moved to SolrParams. But never the less "%2C" ist correct for "," in utf-8. So most likely you have a problem on server side with unencoding the params.

    Try solr in current version, because in this case you don't need to config the servlet container properly: it is now part of solr.

    btw: take a look to sub-facets instead of pivot-faceting: http://yonik.com/solr-subfacets/