You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2016/03/14 18:30:33 UTC
[jira] [Updated] (LUCENE-7102) LatLonPoint newDistanceSort fails
with "sort missing first"
[ https://issues.apache.org/jira/browse/LUCENE-7102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Muir updated LUCENE-7102:
--------------------------------
Attachment: LUCENE-7102.patch
Here is a patch (with tests for missing, and different missingValues).
First we restrict missingValue to either Double.POSITIVE_INFINITY (missing values last) and Double.NEGATIVE_INFINITY (missing values first). This keeps things simpler and will allow for more optimizations.
In either case we can just bound Integer.MIN_VALUE .. Integer.MAX_VALUE for each dimension:
* +Inf means we've filled the priority queue with only missing values, so any possible value competes.
* -Inf means at this point, only missing values can possibly compete anymore (and only if you have another comparator). I don't think we should do anything tricky to optimize this case.
> LatLonPoint newDistanceSort fails with "sort missing first"
> -----------------------------------------------------------
>
> Key: LUCENE-7102
> URL: https://issues.apache.org/jira/browse/LUCENE-7102
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
> Attachments: LUCENE-7102.patch
>
>
> The distance sort comparator creates bounding boxes when the priority queue is full, to speed up sorting.
> But with missing values (which we don't test), they can be e.g. -Inf/+Inf and we do the wrong thing (e.g. try to make illegal infinite bounding boxes).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org