lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: Problem with Numeric range query.
Date Thu, 23 Sep 2010 21:02:54 GMT
Hi,

> Thank you for your timely response.

:-)

> It's going to take me longer to create an isolated test case you can test
this
> with.  I will see what I can do.

That would be fine. Often with a simple test those errors disappear, because
they are problem in the logic somewhere else :) But you should in all cases
try this.

> In the meantime, I have some follow up information in response to your
other
> suggestions.
> 
> 1) I don't think my problem is that the IndexWriter has not committed the
> document.  Here's why:
> 
> 
> In my test case, I first retrieve a document using a different lucene
query on a
> different field.  From that document I extract the value for timestamp
field and
> then perform the NumericRangeQuery on that value as described below.  I
was
> doing as a way to create a unit test that would verify that the
> NumericRangeQuery was working properly.  I think the fact that first query
> found the document is evidence that the IndexWriter had committed the
> document.  Hence, I would expect that if I follow that query with a
> NumericRangeQuery it should be able to find the same document.

Yes. But are you sure, that the timestamp is also indexed? If it's stored
only, it would not find that. Or maybe the other way round.

> 2) I also don't think my problem is values near Long.MIN_VALUE or
> Long.MAX_VALUE.  My values are all timestamps, which are positive integers
> that are not anywhere near those two extremes.  The values originally come
> from the java.util.Date.getTime() method.
> 
> 3) I will try the upper+lower inclusive = true and using same value for
min and
> max, although I don't see how that will change anything.  I have actually
> debugged through the code for NumericRangeQuery, and if minInclusive ==
> false, then min is incremented, and if maxInclusive == false, then max is
> decremented.  So my query:
> 
>    NumericRangeQuery.newLongRange("timestamp",8,timeX-1,timeX,false,true)
> 
> is essentially equivalent to the query you suggest trying:
> 
>    NumericRangeQuery.newLongRange("timestamp",8,timeX,timeX,true,true)
> 
> right?

Yes, it is the same. The Lucene test
TestNumericRangeQuery64.testOneMatchQuery() verifies the upper=lower
inclusive=true thing.

Uwe


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


Mime
View raw message