lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-1777) Error on distance query where miles < 1.0
Date Mon, 03 Aug 2009 09:43:14 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-1777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738249#action_12738249
] 

Michael McCandless commented on LUCENE-1777:
--------------------------------------------

Indeed, this is the exception I see:
{code}
[junit] java.lang.NumberFormatException: Infinite or NaN
[junit] 	at java.math.BigDecimal.<init>(BigDecimal.java:716)
[junit] 	at org.apache.lucene.spatial.tier.CartesianPolyFilterBuilder.getBoxShape(CartesianPolyFilterBuilder.java:81)
[junit] 	at org.apache.lucene.spatial.tier.CartesianPolyFilterBuilder.getBoundingArea(CartesianPolyFilterBuilder.java:109)
[junit] 	at org.apache.lucene.spatial.tier.DistanceQueryBuilder.<init>(DistanceQueryBuilder.java:58)
[junit] 	at org.apache.lucene.spatial.tier.TestCartesian.testRange(TestCartesian.java:152)
{code}

It's happening because the distance (miles) param to CartesianPolyFilterBuilder is an int,
and 0.5 rounds down to 0.  Putting a floor at 1 prevents the exception (resulting in a floor
on the bounding area that can be filtered0, though, I'm not sure why we can't in general have
finer resolution than 1 mile (ie why mile can't be switched to a double instead).

> Error on distance query where miles < 1.0
> -----------------------------------------
>
>                 Key: LUCENE-1777
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1777
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>    Affects Versions: 2.9
>            Reporter: Glen Stampoultzis
>         Attachments: LUCENE-1777.patch
>
>
> If miles is under 1.0 distance query will break.
> To reproduce modify the file
> http://svn.apache.org/viewvc/lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java?revision=794721
> And set the line:
> final double miles = 6.0;
> to 
> final double miles = 0.5;

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
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