Tricia Williams wrote:
Hi,

I'm working on a custom SearchComponent to display context stored in payloads. I noticed that both the FacetComponent and the HighlightComponent are tightly coupled with the ResponseBuilder through the frequent use of doFacet and doHighlight. If I am building a component with similar functionality to highlighting/faceting that will need to check a similar flag how can I do this as a plugin (ie without making any modification to the ResponseBuilder)?

How are people feeling about the stability of this API? Is this the right way to approach this?


An early version of the ResponseBuilder allowed you to subclass the ResponseBuilder for just this reason. We went back and forth on this and in the end tossed it because it felt too complicated.

For custom components, the safest (and most API stable) way to communicate with itself is via the SolrQueryRequest context. That is, you can get/put values into the request:

  Map<Object,Object> context = rb.req.getContext();
  context.put( "mykey", bean );
  bean.doStuff = true;
  ...
  bean = context.get( "mykey" );

As for API stability... I doubt it will have a complete overhaul before 1.3, but I am confident that there will be tweeks. Please give feedback on waht would be better too so we can fix it before things get locked down.

ryan





Thanks,
Tricia



Reply via email to