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

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de

> -----Original Message-----
> From: comparis.ch - Roman Baeriswyl [mailto:roman.baeris...@comparis.ch]
> Sent: Thursday, December 10, 2009 4:35 PM
> To: 'java-user@lucene.apache.org'
> 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: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org



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

Reply via email to