Another thing to consider... If you only need custom stats for the current result page then there is no need to keep stats for the full result set. In this case you could perform your custom collapse and generate the stats just for the current page. The ExpandComponent could be altered to do that because it re-issues the query (and filters) and then collects the expanded groups for the current page. You could also collect the stats for the current page.
Joel Bernstein Search Engineer at Heliosearch On Fri, Jan 23, 2015 at 4:19 PM, tedsolr <tsm...@sciquest.com> wrote: > Thank you so much for your responses Hoss and Shalin. I gather the > DocTransfomer allows manipulations to the doc list returned in the results. > That is very cool. So the transformer has access to the Solr Request. I > haven't seen the hook yet, but I believe you - I'll have to keep looking. > It > would certainly be cleaner to return my stats as "fields" within each doc. > My plan was to attach the stats as a map to the response, and post process > in my app. > > I was able to quickly mock up a custom SearchComponent and verify that it > receives the doc list in sorted order, and that I could retrieve objects > form the request context. So this search component would allow me to simply > "paste" the filtered map of stats to the response. > > Is there a performance benefit one way or the other? Is it just easier in > the DocTransformer since there is a method transform(doc, id) that must get > called for every return doc? > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/How-to-inject-custom-response-data-after-results-have-been-sorted-tp4181545p4181602.html > Sent from the Solr - User mailing list archive at Nabble.com. >