lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mitu2009 <musicfrea...@gmail.com>
Subject Problem using Lucene RangeQuery
Date Thu, 02 Apr 2009 02:40:04 GMT

I'm using Rangequery to get all the documents which have amount between say 0
to 2. When i execute the query, Lucene gives me documents which have amount
greater than 2 also...What am i missing here?

Here is my code: 
Term lowerTerm = new Term("amount", minAmount); 
Term upperTerm = new Term("amount", maxAmount);
RangeQuery amountQuery = new RangeQuery(lowerTerm, upperTerm, true);            
finalQuery.Add(amountQuery, BooleanClause.Occur.MUST);

and here is what goes into my index:
doc.Add(new Field("amount", amount.ToString(), Field.Store.YES,
Field.Index.UN_TOKENIZED, Field.TermVector.YES));
 

Thanks.
-- 
View this message in context: http://www.nabble.com/Problem-using-Lucene-RangeQuery-tp22839692p22839692.html
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.


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


Mime
View raw message