lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morten Lied Johansen <>
Subject Re: Stats per group with StatsComponent?
Date Thu, 01 Dec 2011 13:27:43 GMT
On 30. nov. 2011 14:58, Martijn v Groningen wrote:
> You'll need to create a new second pass collector
> that computes the min / max for the top N groups. This collector then
> needs to
> be wired up in Solr. The AbstractSecondPassGroupingCollector is
> something you can take a look at. It collects the top documents for
> the top N groups.

I've spent some time looking at this code, and I could use a few more 
pointers to see if my assumptions are right, and get some idea of where 
I'm headed.

As far as I understand, I need to create a subclass of 
AbstractSecondPassGroupingCollector, and for each group maintain some 
sort of structure to hold on to my values.

As to getting the values, I think I understand how it works, but if 
anyone could point me towards some documentation about how the 
AtomicReaderContext works, and how to read specific fields, that would 
be great.

My biggest question at the moment is how to get my values into the response?

I was thinking I should create an new Grouping.Command that did this, 
but then it seems I can't include the values directly with each group 
(the lists in the "groups" element), but would need to add a separate 
structure with the values for each group. Am I right in that assumption? 
How can I add more values to the lists in the "groups" element? Which 
behavior would be preferred?

I was hoping to end up with a response that looks sort of like the 
attached XML.

We all live in a yellow subroutine.

View raw message