You may want to take a look at the AnalyticsQuery: http://heliosearch.org/custom-analytics-engine/
This is an extension to the PostFIlter API that gives you direct access to the ResponseBuilder. Joel Bernstein Search Engineer at Heliosearch On Mon, Jan 19, 2015 at 4:28 PM, tedsolr <tsm...@sciquest.com> wrote: > I am investigating possible modifications to the CollapsingQParserPlugin > that > will allow me to collapse documents based on multiple fields. In a quick > test I was able to make this happen with two fields, so I assume I can > expand that to N fields. > > What I'm missing now is the extra data I need per group - the count of > collapsed docs and a summation on one numeric field. With single field > collapsing I could get this info from the standard stats component by using > tagging/excluding on the post filter and setting a stats facet field. Once > there are multiple fields, I lose the "free" stats info since faceting only > works with one field. > > So I'm looking for advice on where/when to collect the extra data, and how > to transport it back to the caller. My first thought is to compute the info > in the collect() method of the DelegatingCollector, and store it with the > filter (somehow) so it can be retrieved in a later custom SearchComponent. > But I've read it is NOT a good idea to get a document within the collect() > method. What is the right way (place) to access a doc field value (not the > ordinal)? > > I read a post by Joel B. where he said you could get access to a > ResponseBuilder directly from a post filter via a static SolrRequestInfo > call. Does this mean I could compute the extra data I need in the post > filter, AND write it out to the response (from the finish() method I > guess)? > No need for a custom SearchComponent? I was thinking I would have to follow > the ExpandComponent model to get the data from the filter, then write it > out > in the process() method. > > This is my first attempt at customizing Solr so I may not be expressing > myself clearly. Thank you for any pointers you can provide. > (using Solr 4.9) > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/How-to-return-custom-collector-info-tp4180502.html > Sent from the Solr - User mailing list archive at Nabble.com. >