Hi

A noobie question. I am uncertain what is the best way to design for my 
requirement which the following.

I want to allow another client in solrj to query solr with a query that is 
handled with a custom handler

localhost:9090/solr/tokenSearch?tokens{!dismax 
qf=content}pear,apples,oyster,king kong&fl=score&rows=1000

i.e. a list of tokens (single word and phrases) is sent in one http call. 

What I would like to do is to search over each individual token and compose a 
single response back to the client

The current approach I have taken is to create a custom search handler as 
follows

<requestHandler name="/tokenSearch" class="solr.SearchHandler">
 <lst name="defaults">
       <str name="defType">dismax</str>         
  </lst>
  <arr name="components">
       <str>myHandler</str>
   </arr>
</requestHandler>

<searchComponent name="myHandler" class="com.a.RequestHandlers.myHandler"/>
   
myHandler (which extends SearchComponent) overrides prepare and process 
methods, extracting and iterating over each token in the input. The problem I 
am hitting in this design is that the prepare() method is passed a reference to 
the SolrIndexSearcher in the ResponseBuilder parameter (so for efficiency 
reasons i don't want to open up another server connection for the search). I 
can construct a Lucene query and search just fine, but what i would like to do 
is instead use the e/dismax queries (rather than construct my own - to reduce 
errors). The getDocList() method of SolrIndexSearcher on the other hand 
requires a lucene query object. 

Is this an appropriate design for my requirement? And if so what is the best 
way to send a SolrQuery to the SolrIndexSearcher?

Thank you 

Peyman

Reply via email to