lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sam s" <tamputa...@hotmail.com>
Subject RE: Filtering Results?
Date Thu, 14 Oct 2004 13:39:31 GMT
Thanks Chuck.

What is the workaround for filtering (preferably using RangeQuery) 
following?
1. Float values. Do I have to pad those with zeros on both sides?
2. Negative numbers (integer as well as floats)

Thanks

>From: "Chuck Williams" <chuck@manawiz.com>
>Reply-To: "Lucene Users List" <lucene-user@jakarta.apache.org>
>To: "Lucene Users List" <lucene-user@jakarta.apache.org>
>Subject: RE: Filtering Results?
>Date: Wed, 13 Oct 2004 21:49:30 -0700
>
>RangeQuery is a good approach.  Put fields on your documents like age.
>The only tricky thing is that the comparisons are all done
>lexicographically rather that numerically.  Lucene has a built-in
>routine to convert dates into a monotonic lexicographic sequence
>(DateField.timeToString).  For positive integer data types like age, it
>is sufficient to store them as fixed line String's, e.g.:
>   5 --> "005"
>  18 --> "018"
>100 --> "100"
>
>Then just access range queries.  E.g.:
>1.  age:[018 TO]
>2.  age:[TO 018]
>3.  age:[005 TO 018]
>
>Those are <= queries.  Use {} instead of [] for < queries.
>
>Good luck,
>
>Chuck
>
> > -----Original Message-----
> > From: sam s [mailto:tamputampu@hotmail.com]
> > Sent: Wednesday, October 13, 2004 12:55 PM
> > To: lucene-user@jakarta.apache.org
> > Subject: Filtering Results?
> >
> > Hi,
> > I want to do filtering on matched results of a query.
> > For example
> > 1. age > 18
> > 2. age < 18
> > 3. age > 5 and age < 18
> > 4. birthdate = [some date]
> > What can be the best approach?
> > How can it be done with range query?
> > Can it be done without range query?
> >
> > Also.
> > Where can I find information meaning of following classes and how to
>use
> > them?
> > FilteredQuery
> > QueryFilter (I didnt understand much looking at test case of this)
> > CachingWrapperFilter
> > etc..
> >
> > Thanks in advance
> >
> > _________________________________________________________________
> > Don't just search. Find. Check out the new MSN Search!
> > http://search.msn.com/
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! 
http://search.msn.com/


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


Mime
View raw message