Return-Path: Delivered-To: apmail-lucene-general-archive@www.apache.org Received: (qmail 35662 invoked from network); 16 Mar 2009 19:55:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Mar 2009 19:55:44 -0000 Received: (qmail 98092 invoked by uid 500); 16 Mar 2009 19:55:43 -0000 Delivered-To: apmail-lucene-general-archive@lucene.apache.org Received: (qmail 97613 invoked by uid 500); 16 Mar 2009 19:55:42 -0000 Mailing-List: contact general-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@lucene.apache.org Delivered-To: mailing list general@lucene.apache.org Received: (qmail 97602 invoked by uid 99); 16 Mar 2009 19:55:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Mar 2009 12:55:42 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of skywind@gmail.com designates 74.125.44.29 as permitted sender) Received: from [74.125.44.29] (HELO yx-out-2324.google.com) (74.125.44.29) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Mar 2009 19:55:35 +0000 Received: by yx-out-2324.google.com with SMTP id 31so1555995yxl.5 for ; Mon, 16 Mar 2009 12:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=K3fWAZsqrXkp6QdbbMHjx8wNbqaB0ZluMFujNz6G3V0=; b=iCvsiJ+/kIRwBJeWV+psh2Tca42kR/flB9sTnfJCywghS3+dfhh+aKopNSpgZyZSm5 COwAndT2tgLu2pqg7LSA/o0txslH1acdJHvKjRyFOLfQ6kSK/A9EGowYZ1Ji/Y1MmhEW wY2XDMdpv7UxxJZgbVx3jvYg3119ezGPRrGcg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=eNNrxdrfNUO0XSxGJq4f3XauQlpE2QMzD+xiVsfuW8/gNzUTSKb1UCv4q1KSO5EuLt STn9MTXYUvX12Y++6QEgpmERIVDfQKD95kNBQrQBMgLR39XuaOve6W3iup9pU4ceHVyY S76GTXpwhwB5JObz6CcxhGeu+7a/7NsdHPH04= MIME-Version: 1.0 Received: by 10.150.137.9 with SMTP id k9mr3630045ybd.149.1237233304749; Mon, 16 Mar 2009 12:55:04 -0700 (PDT) In-Reply-To: References: Date: Mon, 16 Mar 2009 14:55:04 -0500 Message-ID: Subject: Re: operator precedence and confusing result From: Jenny Brown To: general@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Ok, after Mike Klaas's explanation of how it's translated, and a few minutes of really studying your examples, this makes sense to me now. And the number of results makes sense. Now my challenge is how to explain this to my users - oi, what a difference, and subtleties. Thanks for the help. I do have one remaining question. How do proximity searches fit into this? I often have users performing a search like: "music arts"~10 OR "band festival" OR "rock concert" and then reporting back to me that they'll see results containing just the word band, or just the word concert, that don't match an entire phrase. Am I misunderstanding phrase search here? Is the proximity search changing the behavior of the whole query? Jenny Brown On Sun, Mar 8, 2009 at 5:46 PM, Chris Hostetter wrote: > > : A) =A0 medicine AND (cat OR dog OR horse OR fish) =A0 =A0 =3D =A010,000= results > : B) =A0 medicine AND cat OR dog OR horse OR fish =A0 =A0 =A0 =A0=3D 4,00= 0 results > : C) =A0(medicine AND cat) OR dog OR horse OR fish =A0 =A0 =3D 90,000 res= ults > : (which tells me this isn't how B is interpretted) > > it's important to rememebr that Lucene isn't a boolean matching system -- > the undelrying semantics are MUST/MUST_NOT/SHOULD -- the AND/OR > keywords are just syntactic sugar that attempt to apply underlying > semantics as binary opperators. > > if you look at the toString output of queries you can see what the parser > has done to try and apply your use of AND/OR to the underlying query > structures. =A0here's an example of what the toString for those queries > looks like (my analyzer does some stemming, but the structure of hte > queries is going to be the same regardless of the analyzer) > > > A) +text:medicin +(text:cat text:dog text:hors text:fish) > B) +text:medicin +text:cat text:dog text:hors text:fish > C) (+text:medicin +text:cat) text:dog text:hors text:fish > > ...Does the discrepency in the number of results make sense now? > > > -Hoss > >