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 "Bushey, John" <Jo...@pega.com> on 2006/10/16 19:43:33 UTC

BooleanQuery.TooManyClauses exception

Hi - Can someone explain the reason why I'm getting the TooManyClauses
exception?  I have a general understanding of the issue based on my
reading, but I don't understand the mechanics of the it.  Specifically
how is my query being expanded to cause this problem?  How am I
exceeding the default 1024 clauses?  My query looks like the following.

 

pyLabel:(test) OR pyDescription:(test) AND ( pxCreateDateTime:[20060401
TO 20060901] )

 

The problem only happens when my date range exceeds ~2 months.  The date
is indexed with more precision, but for my query purposes I only care
about the date and not the time stamp portion.  What can I do to solve
or mitigate this problem and be able to search a date range that spans
at least a year? Is setMaxClauseCount() a predictable solution?  How
would reducing the precision of my date during indexing help?

 

 

Thanks

John

 

 

 


Re: BooleanQuery.TooManyClauses exception

Posted by Chris Hostetter <ho...@fucit.org>.
RangeQueries expand to a boolean query containing all terms in the range,
so it doesn't matter if you search on a course grain range, if you store
the dates with high granulatiry -- the number of terms will be high.

this wiki page discusses some of the merrits of using multiple date fields
with various levels of granulairty...
http://wiki.apache.org/jakarta-lucene/LargeScaleDateRangeProcessing
...but frankly, i suggest you just use a ConstantScoringRangeQuery (which
uses a RangeFilter under the covers) and save yourself the headache.



: Date: Mon, 16 Oct 2006 13:43:33 -0400
: From: "Bushey, John" <Jo...@pega.com>
: Reply-To: java-user@lucene.apache.org
: To: java-user@lucene.apache.org
: Subject: BooleanQuery.TooManyClauses exception
:
: Hi - Can someone explain the reason why I'm getting the TooManyClauses
: exception?  I have a general understanding of the issue based on my
: reading, but I don't understand the mechanics of the it.  Specifically
: how is my query being expanded to cause this problem?  How am I
: exceeding the default 1024 clauses?  My query looks like the following.
:
:
:
: pyLabel:(test) OR pyDescription:(test) AND ( pxCreateDateTime:[20060401
: TO 20060901] )
:
:
:
: The problem only happens when my date range exceeds ~2 months.  The date
: is indexed with more precision, but for my query purposes I only care
: about the date and not the time stamp portion.  What can I do to solve
: or mitigate this problem and be able to search a date range that spans
: at least a year? Is setMaxClauseCount() a predictable solution?  How
: would reducing the precision of my date during indexing help?
:
:
:
:
:
: Thanks
:
: John
:
:
:
:
:
:
:
:



-Hoss


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