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?

Thanks,
Shawn.

-----Original Message-----
From: Paul Elschot [mailto:[EMAIL PROTECTED]
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:

http://cvs.apache.org/viewcvs.cgi/jakarta-lucene/src/java/org/apache/lucene/
search/DateFilter.java

(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.

Regards,
Paul Elschot


---------------------------------------------------------------------
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]

Reply via email to