On Fri, Aug 30, 2013 at 1:01 PM, Martin Kresse
<m.kresse(a)espresto.com> wrote:
Hello there,
I'd like to try to limit/customize the shown facets in the refinement
panel for the Solr search. This would allow for a custom search page
with different facet fields than the standard search (e.g. the facet
"page" or "date" might not be useful in every case) or the addition
of
custom facet fields, for example "tags".
Instead of modifying the global defaults in solrconfig.xml, I'd want to
name the desired facet fields in the concrete solr query. Like
documented for example in
http://wiki.apache.org/solr/SimpleFacetParameters#Examples, if I want
both fields "cat" and "inStock", I need to add both fieldnames to
the
query for the parameter "facet.field". On the Solr side, the set(String,
String[]) method
(
http://lucene.apache.org/solr/4_2_1/solr-solrj/org/apache/solr/common/param…)
could be used for this. However, the current SolrQueryExecutor
implementation does not support this "multiple arguments" case, so for
example a $query.bindValue('facet.field', ["cat",
"inStock"])) doesn't work.
To solve this problem, I suggest that SolrQueryExecutor.execute() checks
each value of the named parameters for a list and optionally calls
set(String, String[]) instead of set(String, String). I'd gladly supply
a patch for this issue. Is there any interest in this?
Sounds good to me, if you
provide such a pull request I will apply it
or I can take care of this if you prefer.