Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 77156 invoked from network); 26 Aug 2005 18:40:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Aug 2005 18:40:54 -0000 Received: (qmail 70498 invoked by uid 500); 26 Aug 2005 18:40:48 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 70474 invoked by uid 500); 26 Aug 2005 18:40:48 -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 70453 invoked by uid 99); 26 Aug 2005 18:40:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2005 11:40:48 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [194.109.24.22] (HELO smtp-vbr2.xs4all.nl) (194.109.24.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2005 11:41:04 -0700 Received: from k8l.lan (porta.xs4all.nl [80.127.24.69]) by smtp-vbr2.xs4all.nl (8.13.3/8.13.3) with ESMTP id j7QIejpT004619 for ; Fri, 26 Aug 2005 20:40:45 +0200 (CEST) (envelope-from paul.elschot@xs4all.nl) From: Paul Elschot To: java-user@lucene.apache.org Subject: Re: Does order of BooleanQuery clauses affect search performance? Date: Fri, 26 Aug 2005 20:40:44 +0200 User-Agent: KMail/1.5.4 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508262040.44974.paul.elschot@xs4all.nl> X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Friday 26 August 2005 17:58, Paul.Illingworth@saaconsultants.com wrote: > > A simple question and I guess it may have been asked before. > > Does the order of Querys in a BooleanQuery affect search speed? By this I > mean if the first clause of a BooleanQuery only returns a few results and > the second clause returns lots of results and the two are ANDed is this > faster than the other way around? Similarly, does searching stop if no Subqueries of BooleanQuery are called clauses in Lucene. The order of clauses does not matter. Having only required clauses does matter, normally a lot. > results are found and the logical operations would mean no results can be > found (similar to Javas "short circuiting" of logical operations)? The development version tries to do as much "short circuiting" as possible. Lucene 1.4.3 neither short circuits for "or" (optional clauses) nor for "not" (prohibited clauses). Both do short circuiting for "and" (required clauses). Regards, Paul Elschot --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org