lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rifflard Mickaël <Mickael.Riffl...@atosorigin.com>
Subject RE: Lucene and numerical fields search
Date Tue, 12 Jul 2005 08:31:38 GMT
Hi Paul,

I have seen Filter feature and search how to use it to solve my problem.
But users can search in indeterminate range so I don't find how to use filters in that case.

	Mickaël

-----Message d'origine-----
De : Paul.Illingworth@saaconsultants.com
[mailto:Paul.Illingworth@saaconsultants.com]
Envoyé : mardi 12 juillet 2005 10:16
À : java-user@lucene.apache.org
Objet : Re: Lucene and numerical fields search







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                                              
             <Mickael.Rifflard                                             
             @atosorigin.com>                                           To 
                                       <java-user@lucene.apache.org>       
             12/07/2005 08:49                                           cc 
                                                                           
                                                                   Subject 
             Please respond to         Lucene and numerical fields search  
             java-user@lucene.                                             
                apache.org                                                 
                                                                           
                                                                           
                                                                           
                                                                           




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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message