Ouch! Yes, we're indexing with seconds, that's almost certainly the
problem. :( I had no idea that rangequery worked by enumerating every
possible value, that's terrifying. 

We have a requirement to index data going back for about 20 years,
though, and although daily resolution would be fine, this is still 7000
days. That's more than BooleanQuery supports. 

So what's the solution? Surely we're not the only people who need to
search in date ranges going back this far? Does PrefixQuery work the
same way, or can we work around this by doing things like a prefixQuery
for "2005-01-" to catch an entire month in one query, etc?

Cheers,

Tim.

-----Original Message-----
From: Otis Gospodnetic [mailto:[EMAIL PROTECTED] 
Sent: 16 March 2006 17:26
To: java-user@lucene.apache.org
Subject: Re: TooManyClauses exception in Lucene (1.4)


Tim,

This is possible a lot of days:
  date:[2005-03-16 TO 2006-03-16]
And if your 'date' field is more granular than 'a day', then this is a
lot more hours/minutes/seconds/milliseconds.

Your range query is expanded to all unique values in the range.  This is
probably in the FAQ, but if not, look at the first snippet:
http://www.lucenebook.com/search?query=indexing+date+millisecond

If you don't need hours/minutes/seconds/milliseconds, don't index them.

Otis


----- Original Message ----
From: [EMAIL PROTECTED]
To: java-user@lucene.apache.org
Sent: Thursday, March 16, 2006 11:34:29 AM
Subject: TooManyClauses exception in Lucene (1.4)

Hi,

We're using queryparser to generate my queries (not ideal, and we're
planning on rewriting it, but at the moment we don't have the resources
to do so). 

We have a default field "text" which contains all of our text fields,
and a "date" field which is just a string field in the format YYYY-MM-DD
(so we can sort). 

I'm passing in the query string: broadband AND date:[2005-03-16 TO
2006-03-16]^0.01

(I'm weighting the date portion of the query so it doesn't affect the
sorting too heavily). 

Running query.toString gives this: +text:broadband +date:[2005-03-16 TO
2006-03-16]^0.01

When I try to run the query, though, I get this Exception:

    org.apache.lucene.search.BooleanQuery$TooManyClauses
    at
org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:79)
    at
org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:71)
    at
org.apache.lucene.search.RangeQuery.rewrite(RangeQuery.java:99)
    at
org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:243)
    at
org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:166)
    at org.apache.lucene.search.Query.weight(Query.java:84)
    at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:85)
    at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:64)
    at org.apache.lucene.search.Hits.<init>(Hits.java:43)
    at org.apache.lucene.search.Searcher.search(Searcher.java:33)
    at org.apache.lucene.search.Searcher.search(Searcher.java:27)

I know Lucene 1.4 has a limited number of clauses, but assumed two or
three would be okay. :)

Any ideas would be gratefully received! Oddly, this doesn't seem to
occur every time, just with certain date ranges...

Cheers,

Tim.
------------------------------------------------------------------------
--------------------------------------------------------------------
The information contained in this email message may be confidential. If
you are not the intended recipient, any use, interference with,
disclosure or copying of this material is unauthorised and prohibited.
Although this message and any attachments are believed to be free of
viruses, no responsibility is accepted by Informa for any loss or damage
arising in any way from receipt or use thereof.  Messages to and from
the company are monitored for operational reasons and in accordance with
lawful business practices. 
If you have received this message in error, please notify us by return
and delete the message and any attachments.  Further enquiries/returns
can be sent to [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--------------------------------------------------------------------------------------------------------------------------------------------
The information contained in this email message may be confidential. If you are 
not the intended recipient, any use, interference with, disclosure or copying 
of this material is unauthorised and prohibited. Although this message and any 
attachments are believed to be free of viruses, no responsibility is accepted 
by Informa for any loss or damage arising in any way from receipt or use 
thereof.  Messages to and from the company are monitored for operational 
reasons and in accordance with lawful business practices. 
If you have received this message in error, please notify us by return and 
delete the message and any attachments.  Further enquiries/returns can be sent 
to [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to