: 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);
        ...
: 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.

I'm having trouble thinking through exactly where the problem is being 
introduced here ... ultimately what it comes down to is that the NamedList 
souldn't be containing a String[] ... it should be containing multiple 
string values with the same name ("fq")

It would be good to make sure all of these methods play nicely with one 
another so some round trip conversions worked as expected -- so if you 
could open a bug for this with a simple example test case that would be 
great, ...but...

for your purposes, i would skip the NamedList conversion alltogether, 
and just use AppendedSolrParams...

  MapSolrParams myNewParams = new MapSolrParams();
  myNewParams.getMap().put("fq", generatedFileterQuery);
  myNewParams.getMap().put("q", generatedQueryString);
  req.setParams(new AppendedSolrParams(myNewParams, originalPrams));

-Hoss

Reply via email to