lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nestor Oviedo <oviedones...@gmail.com>
Subject facet.field problem in SolrParams to NamedList
Date Tue, 15 Dec 2009 19:01:18 GMT
Hi!
I wrote a subclass of DisMaxQParserPlugin to add a little filter for
processing the "q" param and generate a "fq" param.
Ej.: "q=something field:value" becomes "q=something value&fq=field:value"

To do this, in the createParser method, I apply a regular expression
to the qstr param to obtain the fq part, and then I do the following:

NamedList<Object> paramsList = params.toNamedList();
paramsList.add(CommonParams.FQ, generatedFilterQuery);
params = SolrParams.toSolrParams(paramsList);
req.setParams(params);

The problem is when I include two "facet.field" in the request. In the
results (facets section) it prints "[Ljava.lang.String;@c77a748",
which is the result of a toString() over an String[] .

So, getting a little in deep in the code, I saw the method
SolrParams.toNameList() was saving the array correctly, but the method
SolrParams.toSolrParams(NamedList) was doing:
"params.getVal(i).toString()". So, it always loses the array.

Something similar occurs with the methods SolrParams.toMap() and
SolrParams.toMultiMap().

Is this a bug ?

thanks.
Nestor

Mime
View raw message