java-user@lucene.apache.org
[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

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

> -----Original Message-----
> From: comparis.ch - Roman Baeriswyl [mailto:roman.baeriswyl@xxxxxxxxxxx]
> Sent: Thursday, December 10, 2009 4:35 PM
> To: 'java-user@xxxxxxxxxxxxxxxxx'
> 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-unsubscribe@xxxxxxxxxxxxxxxxx
> For additional commands, e-mail: java-user-help@xxxxxxxxxxxxxxxxx



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: java-user-help@xxxxxxxxxxxxxxxxx

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