lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@lucene.com>
Subject Re: Why does BooleanQuery$TooManyClauses extend RuntimeException?
Date Wed, 26 Nov 2003 17:36:27 GMT
Erik Hatcher wrote:
> 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.

I agree.  I don't object to your patch, but just wanted to note that it 
doesn't address the original issue.

As for the original issue: if we change it to a checked exception, 
unless it is a subclass of IOException, all Lucene applications would 
have to change to accomodate this, which I don't think is acceptable.

So, if folks would like to make this a checked exception, then I guess 
we could make it an IOException.  But that rubs me the wrong way, as it 
doesn't really involve i/o, but is rather more like ArrayOutOfBounds, 
BufferOverflowException. or UnsupportedOperationException, etc., which 
are all (unchecked) subclasses of RuntimeException.  So my preference 
would be to leave it as a RuntimeException.  This will bite a few folks 
who've been (probably unknowingly) using prefix queries that generate 
over 1000 matches, but these folks were also about to run into 
mysterious slowdowns and OutOfMemory exceptions.  I'd rather they got 
TooManyClauses first, increase the limit, and then get slowdowns and 
OutOfMemory.  That way they'll better understand why they're 
experiencing problems.

The fellow who originally complained was able to figure out what was 
going on, and how to prevent it by increasing the limit.  He was just 
unhappy that he had to change something when he upgraded.  So this is 
was not a serious bug, just an annoyance.  Let's not force every user of 
Lucene to update their code for an incompatible change (i.e., annoy lots 
of people) in order to remove the annoyance of a few.

Doug


---------------------------------------------------------------------
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