Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4B0C59FD9 for ; Fri, 20 Apr 2012 00:32:49 +0000 (UTC) Received: (qmail 85382 invoked by uid 500); 20 Apr 2012 00:32:47 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 85323 invoked by uid 500); 20 Apr 2012 00:32:47 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 85314 invoked by uid 99); 20 Apr 2012 00:32:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Apr 2012 00:32:47 +0000 X-ASF-Spam-Status: No, hits=4.0 required=5.0 tests=FREEMAIL_FORGED_REPLYTO,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dmurga@gmail.com designates 209.85.213.48 as permitted sender) Received: from [209.85.213.48] (HELO mail-yw0-f48.google.com) (209.85.213.48) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Apr 2012 00:32:41 +0000 Received: by yhfq46 with SMTP id q46so6234611yhf.35 for ; Thu, 19 Apr 2012 17:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=JGmcgALAhPdFAxhUy8TzFS0fZbuaEpLfDjOcTHEyoVM=; b=sQYg7OOJcDpGDEervN5edurt3h7Jl7zQQAdblH5RMW3PI49q2Qt2QWxvk4u6dpA61N Jcoi7tHz6cuqXNILfpJq3M84C/xq4Bt6xmMsLxOzvJ8rztsMCYoizjT9F1WJYF2lU7hE JsZa3yxg+AqwsbnOf5maKV8Alfq+tNPAtt5tqbWlqhQ87+ca2HOxGmeEBFg6PkPCxYLF dNVrk4v8E7zlghuOtmPSIY4zyckOIVMVmfizSnG95tqn2QtJcFaaBqwiyXHkGx5Rsz66 iNhREdWHVFjTNQI/yV88CTmBI+i/CCkL/3/bp71em3RpQJNONbriEoqUwH10O8+nWqz/ kfdw== MIME-Version: 1.0 Received: by 10.236.109.198 with SMTP id s46mr4143027yhg.43.1334881941262; Thu, 19 Apr 2012 17:32:21 -0700 (PDT) Received: by 10.236.73.136 with HTTP; Thu, 19 Apr 2012 17:32:21 -0700 (PDT) Reply-To: david_murgatroyd@hotmail.com In-Reply-To: References: Date: Thu, 19 Apr 2012 20:32:21 -0400 Message-ID: Subject: Re: DisjunctionMaxQuery and scoring From: David Murgatroyd To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=20cf303ea768ed0f8104be116b86 X-Virus-Checked: Checked by ClamAV on apache.org --20cf303ea768ed0f8104be116b86 Content-Type: text/plain; charset=ISO-8859-1 [apologies for the earlier errant send] I think BooleanQuery bq = new BooleanQuery(false); doesn't quite accomplish the desired "name IN (dick, rich)" scoring behavior. This is because (name:dick | name:rich) with coord=false would score the 'document' "Dick Rich" higher than "Rich" because the former has two term matches and the latter only one. In contrast, I think the desire is that one and only one of the terms in the document match those in the BooleanQuery so that "Rich" would score higher than "Dick Rich", given document length normalization. It's almost like a desire for BooleanQuery bq = new BooleanQuery(false); bq.set*Maximum*NumberShouldMatch(1); Is there a good way to accomplish this? On Thu, Apr 19, 2012 at 7:37 PM, Robert Muir wrote: > On Thu, Apr 19, 2012 at 6:36 PM, Benson Margulies > wrote: > > I see why I'm so confused, but I think I need to construct a simpler > test case. > > > > My top-level BooleanQuery, which has disableCoord=false, has 22 > > clauses. All but three are ordinary SHOULD TermQueries. the remainder > > are a spanNear and a nested BooleanQuery, and an empty PhraseQuery > > (that's a bug). > > > > However, at the end of the explain trace, I see: > > > > 0.45 = coord(9/20) I think that my nested Boolean, for which I've been > > flipping coord on and off to see what happens, is somehow not > > participating at all. So switching it's coord on and off has no > > effect. > > > > Why 20? Why not 22? Is this just an explain quirk? > > I am not sure (also not sure i understand your example totally), but > at the same time could be as simple as the fact you have 2 prohibited > (MUST_NOT) clauses. These don't count towards coord() > > I think its hard to tell from your description (just since it doesn't > have all the details). an explain or test case or something like that > would might be more efficient if its still not making sense... > > -- > lucidimagination.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --20cf303ea768ed0f8104be116b86--