You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by srinir <sr...@nextag.com> on 2012/06/04 10:18:21 UTC

pass custom parameters from client to solr

Hi

I would like to pass  a bunch of custom parameters to turn on/off or set
thresholds for various custom implementations we have in our solr. What
would be the best way to pass these custom parameters to solr server from
the client ? The client is a Java based application and hence we are
planning to use solrj.

Thanks
Srini

--
View this message in context: http://lucene.472066.n3.nabble.com/pass-custom-parameters-from-client-to-solr-tp3987511.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: pass custom parameters from client to solr

Posted by srinir <sr...@nextag.com>.
What would be a good place to read the custom solr params I passed from the
client to solr ? I saw that all the params passed to solr is available in
rb.req.

I have  a business requirement to collapse or combine some properties
together based on some conditions. Currently I have a custom component
(added it as the first component in solrconfig), which reads the custom
params from rb.req.getParams() and remove it from req and put it into
context.  I feel that probably custom component is not the best place and
there could be a better place to do it. Does anyone have any suggestions ?



--
View this message in context: http://lucene.472066.n3.nabble.com/pass-custom-parameters-from-client-to-solr-tp3987511p3988066.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: pass custom parameters from client to solr

Posted by Ahmet Arslan <io...@yahoo.com>.
> Thanks for your reply, that was
> helpful. Is there any restriction on how many
> parameters i can pass ?

I think there are some max limits on GET and POST methods. You can use both using solrJ. POST method enables longer parameters.

http://lucene.apache.org/solr/api/org/apache/solr/client/solrj/SolrRequest.METHOD.html

Also you may need to tweak your servlet container, for example:
http://wiki.apache.org/solr/SolrTomcat#Enabling_Longer_Query_Requests



Re: pass custom parameters from client to solr

Posted by srinir <sr...@nextag.com>.
Thanks for your reply, that was helpful. Is there any restriction on how many
parameters i can pass ?

also can i pass some data (as we pass the document to be indexed, when we
call the update url) along with the parameters which the solr server will
use for search.



--
View this message in context: http://lucene.472066.n3.nabble.com/pass-custom-parameters-from-client-to-solr-tp3987511p3987625.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: pass custom parameters from client to solr

Posted by Ahmet Arslan <io...@yahoo.com>.
> I would like to passĀ  a bunch of custom parameters to
> turn on/off or set
> thresholds for various custom implementations we have in our
> solr. What
> would be the best way to pass these custom parameters to
> solr server from
> the client ? The client is a Java based application and
> hence we are
> planning to use solrj.

You can use custom parameters in the URL. solr/select?q=test&customParam=customValue&rows=10  etc.

SolrJ equivalent :
 SolrQuery query = new SolrQuery();
 query.setRows(10);
 query.set("customParam","customValue");