lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <>
Subject Re: Too many boolean clauses
Date Mon, 20 Sep 2004 16:50:45 GMT
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:

View raw message