Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 97228 invoked from network); 24 Feb 2006 13:52:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Feb 2006 13:52:29 -0000 Received: (qmail 43028 invoked by uid 500); 24 Feb 2006 13:52:22 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 42999 invoked by uid 500); 24 Feb 2006 13:52:22 -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 42988 invoked by uid 99); 24 Feb 2006 13:52:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2006 05:52:22 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mike@curtin.com designates 205.158.62.199 as permitted sender) Received: from [205.158.62.199] (HELO ws6-3.us4.outblaze.com) (205.158.62.199) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 24 Feb 2006 05:52:21 -0800 Received: (qmail 3997 invoked from network); 24 Feb 2006 13:52:01 -0000 Received: from unknown (HELO ?10.1.1.2?) (mike@curtin.com@68.73.12.6) by ws6-3.us4.outblaze.com with SMTP; 24 Feb 2006 13:52:00 -0000 Message-ID: <43FF0F80.5090806@curtin.com> Date: Fri, 24 Feb 2006 08:52:00 -0500 From: "Michael D. Curtin" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: Question to Lucene Index References: <43FF058A.3080308@thopap.de> <43FF08DE.4020508@curtin.com> <43FF0AF4.9000209@i-hypergrid.com> In-Reply-To: <43FF0AF4.9000209@i-hypergrid.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Volodymyr Bychkoviak wrote: > This is not the case. > > maxClauseCount limit number of terms that can fit into BooleanQuery > during some queries rewriting. And default value is 1024, not 32. > > 32 required/prohibited clauses is limitation of Lucene 1.4.3 due to > usage of bit patterns to mask required/prohibited clauses. > You can solve this problem by using Lucene 1.9 RC or use Filters. Doh! Wrong Exception. Volodymyr is right. Thomas, what do your extra clauses look like? Can they be combined in sub-clauses, as it were? For example, if you want hits with A, subject to the restrictions that they don't have B, nor C, ..., you might be able to use a query construct like +A -(B || C || ...) The components of the B || C || ... part aren't required nor prohibited, so you wouldn't run up against the 32 limit (you might hit the 1024 limit, but then you now know how to increase that). If you're constructing the Query yourself (not via the QueryParser), then something like this: BooleanQuery q1 = new BooleanQuery(); q1.add(new TermQuery(new Term("field", "B"), false, false); q1.add(new TermQuery(new Term("field", "C"), false, false); ... q2 = new BooleanQuery(); q2.add(new TermQuery(new Term("field", "A"), true, false); q2.add(q1, false, true); // Use q2 for searching Note also that you could substitute any Query-derived object for the new TermQuery()s in q1. If you need to add restrictions more complicated than a single value of a single field, build up another Query-derived object for that restriction, and put it into q1 instead. Good luck! (And sorry about the misdirection) --MDC --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org