lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martijn v Groningen <>
Subject Re: Stats per group with StatsComponent?
Date Fri, 02 Dec 2011 10:46:59 GMT
Hi Morten,

> 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.
This class is meant for collecting top N documents inside a group. The
reason it is abstract is because it can get its group values from
different source like indexed terms, function results and indexed
I think there should be a new collector type for computing min / max.
This is also a second pass collector b/c it depends on the top
SearchGroups collected by a concrete impl of

> 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.
Well there is the javadoc :) but what is important to remember that
all the grouping collectors work per segment. It needs the
AtomicReaderContext to get the values to do grouping for each segment.

> 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.
I also think the statistics section should included in each group like
in your attached response example.
If the Grouping.Command class gets a new method getStatsCollector()
which returns zero or more collectors.
Each of this collector is executed in the second search, then in the
addDocList method the result of each collector can
be put in the response.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message