lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Why does BooleanQuery$TooManyClauses extend RuntimeException?
Date Wed, 26 Nov 2003 17:14:18 GMT
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


Mime
View raw message