lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martijn van Groningen (Commented) (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3778) Create a grouping convenience class
Date Wed, 15 Feb 2012 22:11:59 GMT


Martijn van Groningen commented on LUCENE-3778:

Yes, it would look something like that.

bq. Would you also handle block (single pass) grouping with the same class...?
I think we can do this. The block grouping returns TopGroups as result.

bq. I guess you'd then .getAllGroups(), .getAllGroupHeads() after .search(...)?
Yes, we need that. In the case of getAllGroups() the TopGroups#totalGroupCount field can be
used when the user is only interested in the number of matching groups.

bq. Hmm would we try to handle Term/BytesRef and Function/MutableValue with the same class?
With generics?
class GroupingSearch {

  public <T> TopGroups<T> search() {


Function usage:
GroupSearch ctx = new GroupingSearch(groupByFunction);
TopGroups<MutableValue> topGroups =, query, numGroups);

The same could work for grouping by docvalues types int and float, right?

Maybe distributed grouping needs its own class? Since the usage is different from a non distributed
> Create a grouping convenience class
> -----------------------------------
>                 Key: LUCENE-3778
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: modules/grouping
>            Reporter: Martijn van Groningen
> Currently the grouping module has many collector classes with a lot of different options
per class. I think it would be a good idea to have a GroupUtil (Or another name?) convenience
class. I think this could be a builder, because of the many options (sort,sortWithinGroup,groupOffset,groupCount
and more) and implementations (term/dv/function) grouping has.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


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

View raw message