: Herein lies the problem from what I can tell: I don�t have any control : over SolrQueryRequest or SolrQueryResponse. My initial attempts have me : subclassing both of these to hold a List of requests and responses, with : a cursor that moves the �current� req/res each time through my handler. : All methods are implemented to delegate directly to the req/res that the : cursor is pointing to. I would check, via instanceof, whether we are : dealing with a normal or composite query in the writer to dump the : results appropriately.
whoa... back up. why do you feel the need to subclass these at all? why don't you just make add the multiple DocLists (from each of the queries) to the same SolrQueryResponse ... there's no limit to the nuber of DocLists that can be added -- you can even give each of them their own name. For that matter: if you have other metadata specific to the individual "component" requests, you can build up a NamedList (or Map or Collection) containing all of that metadata (including hte DocList) and then add that to the SolrQueryResponse. This is already how many of the existing stock components are designed, all you are doing differnetly then some of them is executing multiple "main" searches that produce a DocList -- but i've made several custom components in the past that do the same thing and had no problems. If this doens't seem feasible for your usecase, then please explain in moredepth what your use case is and why it doesn't seem like this would fit. -Hoss