lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <markrmil...@gmail.com>
Subject Re: custom RequestHandler to extend SolrSearch. howto set/get q param
Date Thu, 25 Jun 2009 21:41:33 GMT
Julian Davchev wrote:
> Mark Miller wrote:
>   
>> Rather than using org.apache.solr.request.SolrParams, try using
>> org.apache.solr.common.params.SolrParms.
>>
>>     
> Thanks that really helped. One final issue to solve.    I don't see
> SolrParams.set()     which I guess is normal but how can I
> modify the q param before I pass it further for processing.
> Basically I got...
>
>         SolrParams p = req.getParams();
>         String words = p.get("q");
>         //do something with words....           
>         //assign words back to q param so that the processing is on
> modified q?  What is recommended way to do this?
>
> Thanks
>   
You might try:

SolrParams p = req.getParams();
String words = p.get("q");
ModifiableSolrParams newParams = new ModifiableSolrParams(p)
newParams.set("q", words + stuff);
req.setParams(newParams);


-- 
- Mark

http://www.lucidimagination.com




Mime
View raw message