I would like to transform the following:

/myhandler/?colors=red&colors=blue&materials=leather

to a Query that is similar to:
/select/?fq:colors:(red OR
blue)&fq:materials:leather&facet=on&facet.field=....  and various default
query params.

I tried to do this by providing QParserPlugin:
  <queryParser name="myQueryParser" class="my.QueryParserPlugin"/>
  <requestHandler name="/myhandler" class="solr.SearchHandler">
     <lst name="defaults">
         <!-- various default params -->
         <str name="defType">myQueryParser</str>
     </lst>
  </requestHandler>


In my.QueryParser (returned by my.QueryParserPlugin) I can:
    getReq().getParamString();

and parse that string to get non-default SolrParams.
And, build a Query object to my liking.

Am I going about the right direction?  It'd be much easier if I could place
a custom app proxying solr... But, I am required to expose solr to the
public without middle layer between the browsers and solr.

So, my idea is to reject all solr query params but handful of custom params
such as colors, materials, ..   and build a Query object myself combining
with default SolrParams specified in solrconfig.xml .

Is this feasible?  I don't really like to parse query string myself
(returned by getReq().getParamString()) ..
getReq().getParams()  returns DefaultSolrParams, which does provide a way
to get non-default params only.

Reply via email to