Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@www.apache.org Received: (qmail 80357 invoked from network); 26 Nov 2003 17:14:26 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 26 Nov 2003 17:14:26 -0000 Received: (qmail 91071 invoked by uid 500); 26 Nov 2003 17:14:17 -0000 Delivered-To: apmail-jakarta-lucene-dev-archive@jakarta.apache.org Received: (qmail 91048 invoked by uid 500); 26 Nov 2003 17:14:17 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 91035 invoked from network); 26 Nov 2003 17:14:17 -0000 Received: from unknown (HELO c000.snv.cp.net) (209.228.32.66) by daedalus.apache.org with SMTP; 26 Nov 2003 17:14:17 -0000 Received: (cpmta 28515 invoked from network); 26 Nov 2003 09:14:19 -0800 Received: from 128.143.184.25 (HELO ehatchersolutions.com) by smtp.hatcher.net (209.228.32.66) with SMTP; 26 Nov 2003 09:14:19 -0800 X-Sent: 26 Nov 2003 17:14:19 GMT Date: Wed, 26 Nov 2003 12:14:18 -0500 Subject: Re: Why does BooleanQuery$TooManyClauses extend RuntimeException? Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v553) From: Erik Hatcher To: "Lucene Developers List" Content-Transfer-Encoding: 7bit In-Reply-To: <63733575-2033-11D8-98ED-000393A564E6@ehatchersolutions.com> Message-Id: X-Mailer: Apple Mail (2.553) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Wednesday, November 26, 2003, at 12:10 PM, Erik Hatcher wrote: > > On Wednesday, November 26, 2003, at 11:44 AM, Doug Cutting wrote: >> Erik Hatcher wrote: >>> I concur and have just modified QueryParser to throw a >>> ParseException instead when a TooManyClauses exception is thrown. >> >> When using a prefix or wildcard query (where this is most likely to >> occur) I don't think TooManyClauses is thrown under the parser, but >> rather when searching, as the query isn't rewritten until it's >> executed. > > If that was the case, then this test would fail, right? > > public void testBooleanQuery() throws Exception { > BooleanQuery.setMaxClauseCount(2); > try { > QueryParser.parse("one two three", "field", new > WhitespaceAnalyzer()); > fail("ParseException expected due to too many boolean clauses"); > } catch (ParseException expected) { > // too many boolean clauses, so ParseException is expected > } > } > > But it passes. Nevermind.... my test is not for prefix or wildcard query, but it does show that TooManyClauses can be thrown from QueryParser.parse, which I still feel deserves a ParseException. --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-dev-help@jakarta.apache.org