lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Xu" <oliver.xuy...@gmail.com>
Subject 答复: About the Sorting of Groups during Grouping by
Date Mon, 11 Feb 2013 20:55:06 GMT
Right. I understand that the TermFirstPassGroupingCollector is extended from
Collector class too. Let me try.

Many thanks to you!

-----邮件原件-----
发件人: martijn.is.hier@gmail.com [mailto:martijn.is.hier@gmail.com] 代表
Martijn v Groningen
发送时间: 2013年2月11日 19:29
收件人: java-user@lucene.apache.org
主题: Re: About the Sorting of Groups during Grouping by

Hi,

My purpose is trying to sort the groups based on some way of aggregation
> values of the scores of all the documents in each group, such as their
sums
> or averages.
>
At the moment this isn't possible out of the box. You could implement your
own
collector that collects these statistics per group. Embed the the result in
a FieldComparator
that you use as custom sort in the TermFirstPassGroupingCollector. But this
is just a wild idea.


>
>
>
> There is an 'Enum TopGroups.ScoreMergeMode' in the
> org.apache.lucene.search.grouping package with the description as "How the
> GroupDocs score (if any) should be merged." Is it exactly introduced for
> the
> purpose above? If yes, how to included it into the grouping code? A demo
> code would be perfect.
>
The enum is actually only used by the join module
(ToParentBlockJoinCollector).
The enum controls how the block join group scores are aggregated during a
distributed search.

Martijn


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


Mime
View raw message