Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5BFF59FF2 for ; Tue, 12 Jun 2012 18:52:07 +0000 (UTC) Received: (qmail 83817 invoked by uid 500); 12 Jun 2012 18:52:06 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 83774 invoked by uid 500); 12 Jun 2012 18:52:06 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 83766 invoked by uid 99); 12 Jun 2012 18:52:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2012 18:52:06 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of martijn.is.hier@gmail.com designates 209.85.214.176 as permitted sender) Received: from [209.85.214.176] (HELO mail-ob0-f176.google.com) (209.85.214.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2012 18:51:59 +0000 Received: by obbef5 with SMTP id ef5so11384769obb.35 for ; Tue, 12 Jun 2012 11:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=AWUjI9mEL6pl1VDetx7dNsadePZ/a/YVi7p0ONw86us=; b=MrJSZqbfEiblUTPv6K32aYsXKmyt8MZkS0K/13K4t8AR3W3Kq+a/IuN4WII4O8MfmB YHs+3nLXzYBz+tDLWC8EVmQbE/0B8z0HOUtcremU6mLR5vTSvDKNCysex1qXoeXRCXqF d3hh5AGlksyK0Q7lR2rQbNysTeZUB3ccdHDYRFuuTlJzHDpGyzuGKZoYNyx0hKAMnYnH CwmIWAUC0sCrkKSO8F9SlTMRzyItQIDC4s9mzIG6+f2NdKQZRDossvHJgBUorO8IElfQ 0pg3mENZ3QjM2HXoxDsZXdw4koVoCT3fSPr5k1Lm6z6CK32DvhojWZiPDShJVpNn+09I afyw== Received: by 10.182.111.39 with SMTP id if7mr13876616obb.55.1339527098246; Tue, 12 Jun 2012 11:51:38 -0700 (PDT) MIME-Version: 1.0 Sender: martijn.is.hier@gmail.com Received: by 10.182.81.199 with HTTP; Tue, 12 Jun 2012 11:51:17 -0700 (PDT) In-Reply-To: <1339431007441-3988959.post@n3.nabble.com> References: <1339431007441-3988959.post@n3.nabble.com> From: Martijn v Groningen Date: Tue, 12 Jun 2012 20:51:17 +0200 X-Google-Sender-Auth: D2xPQeepYJm1zNn7mjgRcR02iW8 Message-ID: Subject: Re: Grouping - Boosting large groups To: dev@lucene.apache.org Content-Type: text/plain; charset=UTF-8 Hi Corwin, This not yet possible out of the box. However I think it is possible: 1) Create a Lucene collector that counts for all groups the number of document that match. This collector will basically compute a map with the group value as key and a count as value 2) Run this collector as an extra phase before you run the TermFirstPassGroupingCollector. 3) Use BoostedQuery with a custom value source. The custom value source can emit a boost value per document (via FunctionValues) and in this case you base it on the document count from the group to document count map computed in step 1. Note: This approach is more expensive then what you are doing now. It requires another extra search. Note: The approach assumes lucene 4.0 (which isn't released), but should be possible with lucene 3.6 (I think) Make an issue in Jira about this if you start working on it. This and similar group properties based sorting / boosting are much needed features. Martijn On 11 June 2012 18:10, corwin wrote: > Hi forum, > > I've implemented grouping using the TermFirstPassGroupingCollector and > TermSecondPassGroupingCollector, pretty much exactly as the example at the > API. This works really well. I'm getting a the groups sorted by the computed > relevance, within each groups the docs are sorted by a numeric field. So > far, so good. > > Now I want to make things more complicated by boosting larger groups in > addition to the existing relevance sort. For example, if the first result > has a relevancy score of 1 and the group has 2 docs and the second group has > a score of 0.9 and 4 docs, I want to boost the second group so it will > appear before the first. > > Basically I'm trying to boost the groups according to the number of elements > in the groups. > > I couldn't figure out how to do that or find an example anywhere. > > I hope I'm making sense > > Thanks in advance. > > -- > View this message in context: http://lucene.472066.n3.nabble.com/Grouping-Boosting-large-groups-tp3988959.html > Sent from the Lucene - Java Developer mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org > For additional commands, e-mail: dev-help@lucene.apache.org > -- Met vriendelijke groet, Martijn van Groningen --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org