You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (Commented) (JIRA)" <ji...@apache.org> on 2012/02/15 16:55:03 UTC

[jira] [Commented] (LUCENE-3778) Create a grouping convenience class

    [ https://issues.apache.org/jira/browse/LUCENE-3778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13208550#comment-13208550 ] 

Michael McCandless commented on LUCENE-3778:
--------------------------------------------

This sounds like a good idea!  Grouping is hard to use now...

Would it be something like this?

{noformat}
GroupSearch ctx = new GroupingSearch(groupByField);

ctx.setGroupSort(...);
ctx.setWithinGroupSort(...);
ctx.setNeedsAllGroups(...);
ctx.setNeedsAllGroupHeads(...);
ctx.setUseCaching(...);

topGroups = ctx.search(searcher, query, numGroups);
{noformat}

... and the search method figures out which first/second pass
collectors to make, whether to cache, etc.?

Would you also handle block (single pass) grouping with the same
class...?

I guess you'd then .getAllGroups(), .getAllGroupHeads() after
.search(...)?

Hmm would we try to handle Term/BytesRef and Function/MutableValue
with the same class?

                
> Create a grouping convenience class
> -----------------------------------
>
>                 Key: LUCENE-3778
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3778
>             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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org