Return-Path: Delivered-To: apmail-lucene-solr-user-archive@locus.apache.org Received: (qmail 42782 invoked from network); 8 Apr 2008 02:10:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Apr 2008 02:10:30 -0000 Received: (qmail 65906 invoked by uid 500); 8 Apr 2008 02:10:23 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 65874 invoked by uid 500); 8 Apr 2008 02:10:23 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 65865 invoked by uid 99); 8 Apr 2008 02:10:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Apr 2008 19:10:23 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.69.42.181] (HELO radix.cryptio.net) (208.69.42.181) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Apr 2008 02:09:33 +0000 Received: by radix.cryptio.net (Postfix, from userid 1007) id 6793371C0B1; Mon, 7 Apr 2008 19:09:52 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by radix.cryptio.net (Postfix) with ESMTP id 637FF71C003 for ; Mon, 7 Apr 2008 19:09:52 -0700 (PDT) Date: Mon, 7 Apr 2008 19:09:52 -0700 (PDT) From: Chris Hostetter To: solr-user@lucene.apache.org Subject: Re: operator precedence In-Reply-To: <16541732.post@talk.nabble.com> Message-ID: References: <16541732.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org : What is the default operator precedence between AND and OR in SOLR? For : example if I type a query "A OR B AND C", will it be treated as "(A OR B) : AND C" OR "A OR (B AND C)" Strictly speaking: neither. AND and OR are just aliases for setting the MUST and SHOULD properties of the clauses on both sides, when used like your examples the AND "wins" (i believe) because it comes second. "C AND B OR A" would have differnet results. The wiki is under going maintence right now, but the google cache of this page has some more info... http://wiki.apache.org/jakarta-lucene/BooleanQuerySyntax http://www.google.com/search?hl=en&safe=off&q=http%3A%2F%2Fwiki.apache.org%2Fjakarta-lucene%2FBooleanQuerySyntax&btnG=Search -Hoss