lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Lucene and numerical fields search
Date Tue, 12 Jul 2005 08:15:44 GMT

I have similar requirements. To get around the "Too many clauses" problem I
am creating a Filter (this takes one or two seconds to create on an index
of around 250000 documents) instead of using the RangeQuery. It's not ideal
but it does sidestep the problem. If you are using the same range in your
queries then you can cache the filters and these can be reused on the same
IndexReader/IndexSearcher instance.

Paul I.

             Rifflard Mickaël                                              
   >                                           To 
             12/07/2005 08:49                                           cc 
             Please respond to         Lucene and numerical fields search  

Hi all,

I'm using Lucene as a fulltext search engine since a year now and this one
works well for this.
Now, I want to add to my application search capability like : aField
greater than 10 , aField between 10 and 20.
For this, I used RangeQuery (aField:[10 TO 20] for exemple) and I received
all documents with field between these 2 values.
All was perfect before... benchs. These one were poor. I received results
after dozens of seconds.

Here is reasons of this :

Firstly, I don't know min or max values for my field so a request can be
aField:[0 TO 1000000].
If I understand, this request is tranform in a BooleanQuery with one
million of TermQuery separated by OR.

Secondly, to perform greater than or lower than request, I wanted to use
RangeQuery with Integer.MAX_VALUE (for greater than)
or Integer.MIN_VALUE (for lower than). If I understand always, this
RangeQuery would be transform in a BooleanQuery with many
millions of TermQuery.

How to perform this kind of searchs (with another Lucene use, with anoter
solution, ...) ?

Many thanks for your comments.

             Mickaël Rifflard

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

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

View raw message