You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Angelov, Rossen" <Ro...@thomsonmedia.com> on 2004/10/26 00:35:08 UTC

BooleanQuery - TooManyClauses

Hi,

Why there is a limit on the number of clauses? and is there any harm in
setting MaxClauseCount to Integer.MAX_VALUE?

I'm using a Range Query on a field that represents dates and getting
BooleanQuery$TooManyClauses exception.
This is the query -  +/article/createddateiso8601:[20030101000000 TO
20031231999999]
There are currently over 51,000 documents indexed and every day 30 to 50 new
documents are being indexed.
Lucene 1.4.2

Thanks,
Ross

"This communication is intended solely for the addressee and is
confidential and not for third party unauthorized distribution."


Re: BooleanQuery - TooManyClauses

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Oct 25, 2004, at 6:35 PM, Angelov, Rossen wrote:
> Why there is a limit on the number of clauses? and is there any harm in
> setting MaxClauseCount to Integer.MAX_VALUE?

The harm is in performance and resource utilization.  Rather than do 
this, though, read on...

> I'm using a Range Query on a field that represents dates and getting
> BooleanQuery$TooManyClauses exception.
> This is the query -  +/article/createddateiso8601:[20030101000000 TO
> 20031231999999]

Do you really need to do ranges down to that time level?  Or are you 
really just concerned with date?  If you indexed using YYYYMMDD 
instead, there would only be a maximum of 365 terms in that range, 
whereas you've got zillions (ok, I was too lazy to do the math!  But 
far more than 1,024).

I recommend changing how you index dates, or at least use a different 
field for queries that do not need to concern themselves with the 
timestamp aspect.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org