Hi

I've done similar things as paul.

what I do is extending the default QueryComponent and overwrite the
preparing method,

then I just change the solrparams according to our logic and then call
super.prepare(). Then replace the default QueryComponent with it in my
search/query handler.

In this way, nothing of solr default behavior is touched. I think you can
do your logic in prepare method, and then let solr proceed the search.

I've tested it along with other components in both single solr node and
solrcloud. It works fine.

Hope it helps

Cheers

Bold



On 31 December 2013 06:03, Chris Hostetter <hossman_luc...@fucit.org> wrote:

>
> You don't need to write your own handler.
>
> See the previpous comment about implementing a SearchComponent -- you can
> check for the params in your prepare() method and do whatever side effects
> you want, then register your custom component and hook it into the
> component chain of whatever handler configuration you want (either using
> the "components" <arr> or by specifying it as a "first-components"...
>
>
> https://cwiki.apache.org/confluence/display/solr/RequestHandlers+and+SearchComponents+in+SolrConfig
>
> : I want to save the query into a file when a user is changing a parameter
> in
> : the query, lets say he adds "logTofile=1" then the searchHandler will
> : provide the same result as without this parameter, but in the background
> it
> : will do some logic(ex. save the query to file) .
> : But I dont want to touch solr source code, all I want is to add code(like
> : plugin). if i understand it right I want to write my own search handler
> , do
> : some logic , then pass the data to solr default search handler.
>
>
>
>
> -Hoss
> http://www.lucidworks.com/
>



-- 
All the best

Liu Bo

Reply via email to