[email protected]
[Top] [All Lists]

RE: "IN" Query for NumericFields

Subject: RE: "IN" Query for NumericFields
From: "Uwe Schindler"
Date: Thu, 10 Dec 2009 16:40:28 +0100
You can override QP's newTermQuery method. Look into the list archives and
search for both keywords. There it is also explained how to use
NumericRangeQuery with QP.

The ideal solution to hit exact terms are to use NumericRangeQuery with
upper lower bound indentical and inclusive.


Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
eMail: [email protected]

> -----Original Message-----
> From: comparis.ch - Roman Baeriswyl [mailto:[email protected]]
> Sent: Thursday, December 10, 2009 4:35 PM
> To: [email protected]'
> Subject: "IN" Query for NumericFields
> Hi,
> I do have some indices where I need to get results based on a fixed number
> list (not a range)
> Let's say I have a field named "CategoryID" and I now need all results
> where "CategoryID" is 1,3 or 7.
> In Lucene 2.4 I created a QueryParser which looked like: "CategoryID:(1 3
> 7)". But the Query Parser won't work with NumericFields...
> How can I achieve the same for NumericFields?
> Btw I'm using Lucene.net.
> Thanks for Help
> //Roman
> comparis.ch auf Twitter folgen: http://twitter.com/comparis
> Ein Freund auf Facebook werden: http://www.facebook.com/comparis.ch
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]

[email protected]----
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

<Prev in Thread] Current Thread [Next in Thread>