Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 63263 invoked from network); 30 Oct 2007 09:20:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2007 09:20:26 -0000 Received: (qmail 38683 invoked by uid 500); 30 Oct 2007 09:18:45 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 38659 invoked by uid 500); 30 Oct 2007 09:18:45 -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 38645 invoked by uid 99); 30 Oct 2007 09:18:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2007 02:18:45 -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: local policy) Received: from [213.133.51.241] (HELO mail.hippo.nl) (213.133.51.241) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2007 09:18:49 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5.7235.2 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Search performance using BooleanQueries in BooleanQueries Date: Tue, 30 Oct 2007 10:18:25 +0100 Message-ID: In-Reply-To: <200710291743.14297.paul.elschot@xs4all.nl> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Search performance using BooleanQueries in BooleanQueries Thread-Index: AcgaSuHUeraT090iQBSFnWw+jtgtzgAit9MQ References: <200710291743.14297.paul.elschot@xs4all.nl> From: "Ard Schrijvers" To: X-Virus-Checked: Checked by ClamAV on apache.org > On Friday 26 October 2007 09:36:58 Ard Schrijvers wrote: > > Hello, > > > > I am seeing that a query with boolean queries in boolean=20 > queries takes=20 > > much longer than just a single boolean query when the=20 > number of hits=20 > > if fairly large. For example > > > > +prop1:a +prop2:b +prop3:c +prop4:d +prop5:e > > > > is much faster than > > > > (+(+(+(+prop1:a +prop2:b) +prop3:c) +prop4:d) +prop5:e) > > > > where the second one is a result from BooleanQuery in BooleanQuery,=20 > > and all have Occur.MUST. > > > > Is there a way to detect and rewrite the second inefficient query? > > query.rewrite() does not change the query AFAICS. >=20 > SImplifying boolean queries like this is not available in=20 > Lucene, but it would have a positive effect on search=20 > performance, especially when prop1:a and prop2:b have a high=20 > document frequency. >=20 > You could write this yourself, for example by overriding=20 > BooleanQuery.rewrite(). Take care about query weights, though. Thanks for the pointer! Regards Ard >=20 > Regards, > Paul Elschot >=20 >=20 > > > > thanks for any help, > > > > Regards Ard >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org