Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 37943 invoked from network); 7 Jul 2008 16:20:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Jul 2008 16:20:36 -0000 Received: (qmail 26979 invoked by uid 500); 7 Jul 2008 16:20:30 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 26952 invoked by uid 500); 7 Jul 2008 16:20:30 -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 26941 invoked by uid 99); 7 Jul 2008 16:20:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jul 2008 09:20:30 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of erickerickson@gmail.com designates 209.85.142.184 as permitted sender) Received: from [209.85.142.184] (HELO ti-out-0910.google.com) (209.85.142.184) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jul 2008 16:19:38 +0000 Received: by ti-out-0910.google.com with SMTP id b8so572020tic.11 for ; Mon, 07 Jul 2008 09:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=xsg4PCib77XiKztex1JETj0DPPw27Vut5tT3Vc1KfAk=; b=JZllLG8WX1u3IgRqvn5rbBBBUqtnC2NNT8g3XgUMS1Y1Zp84lINkUv/AQm4cpi79I6 tIWTS+msMGr/LLCyF4rxtECNRNAROm9ZRVAv3T6qyi2RsZCjxC1/Fzk9KD8fxL4r+1d/ Xx81/eFP+6X9Hfar5akMzBHi1aN4fNoO4WQbg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=meTLbD5BhULgHF3wxlz2fosvtj0FxYaj0YYOx3uCDHsIwa2anUFP6xUF+Q7rVwX+Q+ oF5sXuTJdcix32uUXfbLmNFBE3L7B7+5tELJz2pWRYnsz2ZdIr/+y6eCPLKYYXBZdtls UP3qOQwNLwFLm6yEvT3/VY+YAXcihyaGZcZHo= Received: by 10.151.153.19 with SMTP id f19mr8465731ybo.116.1215447598208; Mon, 07 Jul 2008 09:19:58 -0700 (PDT) Received: by 10.151.40.4 with HTTP; Mon, 7 Jul 2008 09:19:58 -0700 (PDT) Message-ID: <359a92830807070919y550b73d9wef38df149a9535e5@mail.gmail.com> Date: Mon, 7 Jul 2008 12:19:58 -0400 From: "Erick Erickson" To: java-user@lucene.apache.org Subject: Re: disable boolean operators ? In-Reply-To: <0833DC23-F7DB-412F-885E-E99FEE3C87CB@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_19000_6087377.1215447598197" References: <0833DC23-F7DB-412F-885E-E99FEE3C87CB@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_19000_6087377.1215447598197 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I think you're off base a little. Lucene defaults to 1,024 boolean clauses as the maximum number allowed. There is an implied boolean between each term no matter what. Removing OR, AND, NOT doesn't change that in the least. That is, term1 term2 term3 is equivalent to term1 OR term2 OR term3 So removing the booleans is having no effect on the error. The fact that you have over 2,000 terms is the issue. But you can change the number by BooleanQuery.setMaxClauseCount Best Erick On Mon, Jul 7, 2008 at 12:04 PM, Balthasar Schopman wrote: > Hiya, > > Is there a way to disable boolean operators in the Lucene engine? > > The reason for this question is the mystical / unexpected exception I > encounter when parsing a query containing many words. I query on a single > field with a query containing 2243 words (14.742 characters). I haven't had > this issue with smaller queries. I remove the Lucene special characters (+, > -, &&, ||, !, (, ), {, }, [, ], ^, \, ~, *, ?, :, \) and boolean operators > (AND, OR, NOT) from string before including them in a query. Then I > construct the query as follows: > Query q = new QueryParser("alldata", analyser).parse(queryString); > and call > Hits hits = searcher.search(q); > > An exception with the following message is thrown: > Cannot parse '': too many boolean clauses > > Kind regards, > Balthasar Schopman > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > ------=_Part_19000_6087377.1215447598197--