lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] [Commented] (LUCENE-7061) fix remaining api issues with XYZPoint classes
Date Wed, 02 Mar 2016 20:14:18 GMT


Michael McCandless commented on LUCENE-7061:

Thanks [~rcmuir], this is a really nice cleanup.  +1

{{PointRangeQuery}} is so much simpler!

Given that this is a big improvement to a new 6.0 feature I think we should backport this
for 6.0?  @nknize is that ok?

> fix remaining api issues with XYZPoint classes
> ----------------------------------------------
>                 Key: LUCENE-7061
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>         Attachments: LUCENE-7061.patch
> There are still some major problems today:
> XYZPoint.newRangeQuery has "brain damage" from variable length terms. nulls for open
ranges make no sense: these are fixed-width types and instead you can use things like Integer.maxValue.
Removing the nulls is safe, as we can just switch to primitive types instead of boxed types.
> XYZPoint.newRangeQuery requires boolean arrays for inclusive/exclusive, but thats just
more brain damage. If you want to exclude an integer, you just subtract 1 from it and other
simple stuff.
> For the apis, this means Instead of:
> {code}
> public static Query newRangeQuery(String field, Long lowerValue, boolean lowerInclusive,
Long upperValue, boolean upperInclusive);
> public static Query newMultiRangeQuery(String field, Long[] lowerValue, boolean lowerInclusive[],
Long[] upperValue, boolean upperInclusive[]);
> {code}
> we have:
> {code}
> public static Query newRangeQuery(String field, long lowerValue, long upperValue);
> public static Query newRangeQuery(String field, long[] lowerValue, long[] upperValue);
> {code}
> PointRangeQuery is horribly complex due to these nulls and boolean arrays, and need not
be. Now it only works "inclusive" and is much simpler.
> XYZPoint.newSetQuery throws IOException, just creating the query. This is very confusing
and unnecessary (no i/o happens).
> LatLonPoint's bounding box query is not inclusive like the other geo. And the test does
not fail!
> I also found a few missing checks here and there while cleaning up.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message