lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Konopinsky <>
Subject RE: Too many boolean clauses
Date Mon, 20 Sep 2004 18:54:01 GMT
Hey Paul,

Thanks for the quick reply. Excuse my ignorance, but what do I do with the
generated BitSet?

Also - we are using a pooling feature which contains a pool of
IndexSearchers that are used and tossed back each time we need to search.
I'd hate to have to work around this and open up an IndexReader for this
particular search, where all other searches use the pool. Suggestions?


-----Original Message-----
From: Paul Elschot []
Sent: Monday, September 20, 2004 12:51 PM
To: Lucene Users List
Subject: Re: Too many boolean clauses

On Monday 20 September 2004 18:27, Shawn Konopinsky wrote:
> Hello There,
> Due to the fact that the [# TO #] range search works lexographically, I am
> forced to build a rather large boolean query to get range data from my
> index.
> I have an ID field that contains about 500,000 unique ids. If I want to
> query all records with ids [1-2000],  I build a boolean query containing
> all the numbers in the range. eg. id:(1 2 3 ... 1999 2000)
> The problem with this is that I get the following error :
> org.apache.lucene.queryParser.ParseException: Too many boolean clauses
> Any ideas on how I might circumvent this issue by either finding a way to
> rewrite the query, or avoid the error?

You can use this as an example:

(Just click view on the latest version to see the code).

and iteratate over you doc ids instead of over dates.
This will give you a filter for the doc ids you want to query.

Paul Elschot

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message