Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-Dev

Custom distributed SearchHandler: where do I store information in the ResponseBuilder from handleResponses->finishStage

 

 

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded


Cody.Young at move

Jun 21, 2012, 5:32 PM

Post #1 of 2 (39 views)
Permalink
Custom distributed SearchHandler: where do I store information in the ResponseBuilder from handleResponses->finishStage

Okay, so I'm making a custom distributed SearchComponent. It does something similar to facet_queries for the distributed portion.

Modifies purpose_get_top_ids to modify the shard queries, handleResponses to aggregate information and then adds it to the response output in the finishStage.

Facets stores its data in a field in ResponseBuilder:
public FacetComponent.FacetInfo _facetInfo;

I could add my own field, but it feels strange to have to edit solr code to create a new SearchHandler plugin.

Thanks,
Cody


hossman_lucene at fucit

Jun 25, 2012, 2:28 PM

Post #2 of 2 (36 views)
Permalink
Re: Custom distributed SearchHandler: where do I store information in the ResponseBuilder from handleResponses->finishStage [In reply to]

: Subject: Custom distributed SearchHandler: where do I store information in the
: ResponseBuilder from handleResponses->finishStage

...

: Facets stores its data in a field in ResponseBuilder:
: public FacetComponent.FacetInfo _facetInfo;
:
: I could add my own field, but it feels strange to have to edit solr code
: to create a new SearchHandler plugin.

Agreed.

The API for writing SearchComponents was primarily designed to make it
straightforward to refactor a lot of stuff that use to be hardcoded in the
old StandardRequestHandler so that it could be in components, and that new
third-party components could be written -- but (in my opinon) the
SearchComponent/ResponseBuilder APIs arent very good or freindly to
writing third-party components .... but i've never had much luck thinking
of anything better.

The only way i know of for a third-party custom SearchComponent (that
isn't replacing/overriding built in component) to keep track of arbitrary
data using ResponseBuilder is to leverage the
SolrQueryRequest's getContext(). You can put anything you wnat in there
during the various stages of a distributed request, and then
when you are all finished and have the final computed vlaues you want to
return, add it to the SolrQueryResponse.





-Hoss

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe [at] lucene
For additional commands, e-mail: dev-help [at] lucene

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.