You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "iverase (via GitHub)" <gi...@apache.org> on 2023/02/20 11:36:56 UTC

[GitHub] [lucene] iverase opened a new pull request, #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

iverase opened a new pull request, #12162:
URL: https://github.com/apache/lucene/pull/12162

   Add new field that index both LatLonPoint and LatLonDocValues and provides factory methods for the operations that can be performed. Those are:
   
   ```
   Query newGeometryQuery(String field, ShapeField.QueryRelation queryRelation, LatLonGeometry... latLonGeometries);
   
   Query newDistanceFeatureQuery(String field, float weight, double originLat, double originLon, double pivotDistanceMeters) ;
   
   TopFieldDocs nearest( IndexSearcher searcher, String field, double latitude, double longitude, int n);
   
   SortField newDistanceSort(String field, double latitude, double longitude) ;
   ```
   
   
   closes https://github.com/apache/lucene/issues/12161


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] nknize commented on a diff in pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "nknize (via GitHub)" <gi...@apache.org>.
nknize commented on code in PR #12162:
URL: https://github.com/apache/lucene/pull/12162#discussion_r1150921848


##########
lucene/core/src/java/org/apache/lucene/document/LatLonField.java:
##########
@@ -0,0 +1,318 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.document;
+
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLongitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude;
+
+import java.io.IOException;
+import org.apache.lucene.geo.LatLonGeometry;
+import org.apache.lucene.geo.Point;
+import org.apache.lucene.geo.Polygon;
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.FieldDoc;
+import org.apache.lucene.search.IndexOrDocValuesQuery;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MatchAllDocsQuery;
+import org.apache.lucene.search.MatchNoDocsQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.TopFieldDocs;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.NumericUtils;
+
+/**
+ * An indexed location field for querying and sorting. If you need more fine-grained control you can
+ * use {@link LatLonPoint} and {@link LatLonDocValuesField}.
+ *
+ * <p>Finding all documents within a range at search time is efficient. Multiple values for the same
+ * field in one document is allowed.
+ *
+ * <p>This field defines static factory methods for common operations:
+ *
+ * <ul>
+ *   <li>{@link #newBoxQuery newBoxQuery()} for matching points within a bounding box.
+ *   <li>{@link #newDistanceQuery newDistanceQuery()} for matching points within a specified
+ *       distance.
+ *   <li>{@link #newPolygonQuery newPolygonQuery()} for matching points within an arbitrary polygon.
+ *   <li>{@link #newGeometryQuery newGeometryQuery()} for matching points complying with a spatial
+ *       relationship with an arbitrary geometry.
+ *   <li>{@link #newDistanceFeatureQuery newDistanceFeatureQuery()} for returning points scored by
+ *       distance to a specified location.
+ *   <li>{@link #nearest nearest()} for returning the nearest points from a specified location.
+ *   <li>{@link #newDistanceSort newDistanceSort()} for ordering documents by distance from a
+ *       specified location.
+ * </ul>
+ *
+ * <p>If you also need to store the value, you should add a separate {@link StoredField} instance.
+ *
+ * <p><b>WARNING</b>: Values are indexed with some loss of precision from the original {@code
+ * double} values (4.190951585769653E-8 for the latitude component and 8.381903171539307E-8 for
+ * longitude).
+ *
+ * @see LatLonPoint
+ * @see LatLonDocValuesField
+ */
+public class LatLonField extends Field {

Review Comment:
   @jpountz <type>Field is fine... I'm not saying not to name it that.. I'm saying <type> should be `LatLonPoint` so it's not misleading users that this field supports both `LatLonPoint` and `LatLonShape`. Because it doesn't.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] MarcusSorealheis commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "MarcusSorealheis (via GitHub)" <gi...@apache.org>.
MarcusSorealheis commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437977171

   At this point, I don't know how a feature like Spatial knn could be implemented and it certainly would not rely on doc values for the approximation query, the existing and proposed implementations could be reused to have reduce the candidate set before comparing dense values. The question I have is does this abstraction benefit us there? My intuition is yes, barely. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] rmuir commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1438469151

   Perhaps we need to walk thru an example. A user wants to only documents within 25km of their current location, very typical.
   
   This signature is pretty intuitive for that use-case:
   ```
   Query newDistanceQuery(String field, double latitude, double longitude, double radiusMeters);
   ```
   
   This one is not:
   ```
   Query newGeometryQuery(String field, ShapeField.QueryRelation queryRelation, LatLonGeometry... latLonGeometries);
   ```
   
   * ShapeField.QueryRelation: Which one should i use? The javadocs provides **zero help** on what the relationships mean: https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/document/ShapeField.java#L119-L128. Furthermore, many of these relationships simply **don't make sense** for points which are infinitely small. "oh but it works for both shapes and points" is like saying "oh but i made an abstraction that works for both quicksorts and hashtables", it doesnt make sense why you did that in the first place, you just made shit confusing for no good reason.
   * LatLonGeometry...: this isn't too helpful, again we have a class has **zero javadocs** https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/geo/LatLonGeometry.java#L20. 
   
   So at the end of the day, as a simple user trying to do a distance query, i can dig thru all these crazy relationships and abstractions, and ultimately determine that in order to find documents within 25km i need to create a `Circle` object and then ask for documents that `INTERSECTS` it with my point? 
   
   Or i could just use a non-fucking-insane api that just takes my point and distance in kilometers as parameters.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] rmuir commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437100061

   and yeah, to be clear i'm -1 against this change until we address this. I also have serious concerns about anyone who thinks this newGeometryQuery is "the most typical API". Stop, breathe, take a step back, and actually look at it. it's trash. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] rmuir commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1438428404

   just look at the code to see what i mean: https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/document/LatLonPoint.java#L325-L341
   
   The worst part is, the user who just wants to find points in their bounding box or simple polygon, doesn't think that they should be using `INTERSECTS` because the verb is senseless when thinking of something that is infinitely small.
   
   This disastrous api should be completely removed from LatLonPoint, too. Keep it for shapes if you want.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] jpountz commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "jpountz (via GitHub)" <gi...@apache.org>.
jpountz commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1438438628

   For `KeywordField` and `LongField`/`DoubleField` we ended up adding an option to the ctor to store the field. This PR doesn't have this, but I'm unsure what should be the canonical representation of a geo point in stored fields. So maybe it's best to leave it to the app depending on whether they'd rather store it as a string, two doubles, or something else?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] MarcusSorealheis commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "MarcusSorealheis (via GitHub)" <gi...@apache.org>.
MarcusSorealheis commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1440954007

   > I don't care about use of it for shapes since only 0.001% of users give a crap about shapes
   
   that's correct, today.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] rmuir commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437062026

   Can we add newPolygonQuery and newBoxQuery just like LatLonPoint already has?
   
   To me, the newGeometryQuery method is unusable and overcomplicated. No user should struggle with how to do a basic bounding box or point-in-polygon query with it (and it isn't obvious whatsoever).
   
   Let's give the user meaningful methods that match common use-cases.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] nknize commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "nknize (via GitHub)" <gi...@apache.org>.
nknize commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1440455711

   > This PR doesn't have this, but I'm unsure what should be the canonical representation of a geo point in stored fields.
   
   @jpountz Thinking out loud here, would it make sense to add something like a `StoredFieldCanonicalFormat` interface that offers  `Object format(BytesRef ...`  `Object format(long ...`  methods? This way we could decide to store LatLonPoint as an efficient integer encoded XY long value and provide standard formatters like:
   
   `LatLonPointStandardFormatter`  - formats to standard lat, lon string representation.
   `LatLonPointJSONFormatter` - formats to the geojson standard string representation. 
   `XYPointStandardFormatter` - formats to standard x, y string representation.
   
   Of course we could keep things tidy by having something like
   
   ```java
   public class LatLonPointStandardFormatter {
     public static class JSON implements StoredFieldCanonicalFormat {
       @override
       public String format(BytesRef value) {
           StringBuffer sb = ...
           return sb.toString();
       }
     }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] rmuir commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437097724

   LOL, dude who do you think wrote the point-in-polygon, distance, box stuff here? I guess i "should not be developing a geo application"
   
   What use-case does this crappy newGeometryQuery solve that the other methods don't? Nothing. You could always do box, distance, and arbitrarily-complex multipolygon without this method. it isn't necessary whatsoever.
   
   You seem to be in love with it, for some pride or aesthetical reasons, but it serves no real concrete use cases. Doesn't belong here!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] iverase commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "iverase (via GitHub)" <gi...@apache.org>.
iverase commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437106462

   -1 for removing it so here we are.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] iverase commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "iverase (via GitHub)" <gi...@apache.org>.
iverase commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1438631454

   > For KeywordField and LongField/DoubleField we ended up adding an option to the ctor to store the field. This PR doesn't have this, but I'm unsure what should be the canonical representation of a geo point in stored fields. So maybe it's best to leave it to the app depending on whether they'd rather store it as a string, two doubles, or something else?
   
   I noticed that what I decided not to add it because as you said, there is no canonical representation of a point.
   
   
   I added javadocs to LatLonGeometry and the #newGeometryQuery function. In addition I tagged the method as expert so hopefully that overcomes the issues raised here.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] nknize commented on a diff in pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "nknize (via GitHub)" <gi...@apache.org>.
nknize commented on code in PR #12162:
URL: https://github.com/apache/lucene/pull/12162#discussion_r1114644266


##########
lucene/core/src/java/org/apache/lucene/document/LatLonField.java:
##########
@@ -0,0 +1,318 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.document;
+
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLongitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude;
+
+import java.io.IOException;
+import org.apache.lucene.geo.LatLonGeometry;
+import org.apache.lucene.geo.Point;
+import org.apache.lucene.geo.Polygon;
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.FieldDoc;
+import org.apache.lucene.search.IndexOrDocValuesQuery;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MatchAllDocsQuery;
+import org.apache.lucene.search.MatchNoDocsQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.TopFieldDocs;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.NumericUtils;
+
+/**
+ * An indexed location field for querying and sorting. If you need more fine-grained control you can
+ * use {@link LatLonPoint} and {@link LatLonDocValuesField}.
+ *
+ * <p>Finding all documents within a range at search time is efficient. Multiple values for the same
+ * field in one document is allowed.
+ *
+ * <p>This field defines static factory methods for common operations:
+ *
+ * <ul>
+ *   <li>{@link #newBoxQuery newBoxQuery()} for matching points within a bounding box.
+ *   <li>{@link #newDistanceQuery newDistanceQuery()} for matching points within a specified
+ *       distance.
+ *   <li>{@link #newPolygonQuery newPolygonQuery()} for matching points within an arbitrary polygon.
+ *   <li>{@link #newGeometryQuery newGeometryQuery()} for matching points complying with a spatial
+ *       relationship with an arbitrary geometry.
+ *   <li>{@link #newDistanceFeatureQuery newDistanceFeatureQuery()} for returning points scored by
+ *       distance to a specified location.
+ *   <li>{@link #nearest nearest()} for returning the nearest points from a specified location.
+ *   <li>{@link #newDistanceSort newDistanceSort()} for ordering documents by distance from a
+ *       specified location.
+ * </ul>
+ *
+ * <p>If you also need to store the value, you should add a separate {@link StoredField} instance.
+ *
+ * <p><b>WARNING</b>: Values are indexed with some loss of precision from the original {@code
+ * double} values (4.190951585769653E-8 for the latitude component and 8.381903171539307E-8 for
+ * longitude).
+ *
+ * @see LatLonPoint
+ * @see LatLonDocValuesField
+ */
+public class LatLonField extends Field {

Review Comment:
   These class names are getting super inconsistent. Since this targets points can we refactor this to `LatLonPointField` so as to not confuse general `LatLonField` w/ `ShapeField`? I think this also makes it more consistent w/ `LatLonPointSortField`. 



##########
lucene/core/src/java/org/apache/lucene/geo/LatLonGeometry.java:
##########
@@ -17,7 +17,23 @@
 
 package org.apache.lucene.geo;
 
-/** Lat/Lon Geometry object. */
+/**
+ * Represents a unified view of the supported geometries on the earth's surface. They can determine
+ * their spatial relationship against data indexed with {@link
+ * org.apache.lucene.document.LatLonField}, {@link org.apache.lucene.document.LatLonPoint} and
+ * {@link org.apache.lucene.document.LatLonDocValuesField}.
+ *
+ * <p>The supported geometries are:
+ *
+ * <ol>
+ *   <li>{@link Point}
+ *   <li>{@link Line}
+ *   <li>{@link Polygon}
+ *   <li>{@link Circle}
+ * </ol>
+ *
+ * @lucene.experimental
+ */
 public abstract class LatLonGeometry extends Geometry {

Review Comment:
   In the spirit of internal vs public facing APIs, is there a need to keep this class public? This is a generic contract to enable  `Circle`, `Line`, `Point`, `Polygon`, `Rectangle` geometries to implement `Component2D` comparisons. I don't think we need/want to expose this to downstream projects implementing their own geometries? 



##########
lucene/core/src/java/org/apache/lucene/document/LatLonField.java:
##########
@@ -0,0 +1,318 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.document;
+
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLongitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude;
+
+import java.io.IOException;
+import org.apache.lucene.geo.LatLonGeometry;
+import org.apache.lucene.geo.Point;
+import org.apache.lucene.geo.Polygon;
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.FieldDoc;
+import org.apache.lucene.search.IndexOrDocValuesQuery;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MatchAllDocsQuery;
+import org.apache.lucene.search.MatchNoDocsQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.TopFieldDocs;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.NumericUtils;
+
+/**
+ * An indexed location field for querying and sorting. If you need more fine-grained control you can
+ * use {@link LatLonPoint} and {@link LatLonDocValuesField}.
+ *
+ * <p>Finding all documents within a range at search time is efficient. Multiple values for the same
+ * field in one document is allowed.
+ *
+ * <p>This field defines static factory methods for common operations:
+ *
+ * <ul>
+ *   <li>{@link #newBoxQuery newBoxQuery()} for matching points within a bounding box.
+ *   <li>{@link #newDistanceQuery newDistanceQuery()} for matching points within a specified
+ *       distance.
+ *   <li>{@link #newPolygonQuery newPolygonQuery()} for matching points within an arbitrary polygon.
+ *   <li>{@link #newGeometryQuery newGeometryQuery()} for matching points complying with a spatial
+ *       relationship with an arbitrary geometry.
+ *   <li>{@link #newDistanceFeatureQuery newDistanceFeatureQuery()} for returning points scored by
+ *       distance to a specified location.
+ *   <li>{@link #nearest nearest()} for returning the nearest points from a specified location.
+ *   <li>{@link #newDistanceSort newDistanceSort()} for ordering documents by distance from a
+ *       specified location.
+ * </ul>
+ *
+ * <p>If you also need to store the value, you should add a separate {@link StoredField} instance.
+ *
+ * <p><b>WARNING</b>: Values are indexed with some loss of precision from the original {@code
+ * double} values (4.190951585769653E-8 for the latitude component and 8.381903171539307E-8 for
+ * longitude).
+ *
+ * @see LatLonPoint
+ * @see LatLonDocValuesField
+ */
+public class LatLonField extends Field {
+  /** LatLonPoint is encoded as integer values so number of bytes is 4 */
+  public static final int BYTES = Integer.BYTES;
+  /**
+   * Type for an indexed LatLonPoint
+   *
+   * <p>Each point stores two dimensions with 4 bytes per dimension.
+   */
+  public static final FieldType TYPE = new FieldType();
+
+  static {
+    TYPE.setDimensions(2, Integer.BYTES);
+    TYPE.setDocValuesType(DocValuesType.SORTED_NUMERIC);
+    TYPE.freeze();
+  }
+
+  // holds the doc value value.
+  private long docValue;
+
+  /**
+   * Change the values of this field
+   *
+   * @param latitude latitude value: must be within standard +/-90 coordinate bounds.
+   * @param longitude longitude value: must be within standard +/-180 coordinate bounds.
+   * @throws IllegalArgumentException if latitude or longitude are out of bounds
+   */
+  public void setLocationValue(double latitude, double longitude) {
+    final byte[] bytes;
+
+    if (fieldsData == null) {
+      bytes = new byte[8];
+      fieldsData = new BytesRef(bytes);
+    } else {
+      bytes = ((BytesRef) fieldsData).bytes;
+    }
+
+    int latitudeEncoded = encodeLatitude(latitude);
+    int longitudeEncoded = encodeLongitude(longitude);
+    NumericUtils.intToSortableBytes(latitudeEncoded, bytes, 0);
+    NumericUtils.intToSortableBytes(longitudeEncoded, bytes, Integer.BYTES);
+    docValue = Long.valueOf((((long) latitudeEncoded) << 32) | (longitudeEncoded & 0xFFFFFFFFL));
+  }
+
+  @Override
+  public Number numericValue() {
+    return docValue;
+  }
+
+  /**
+   * Creates a new LatLonPoint with the specified latitude and longitude
+   *
+   * @param name field name
+   * @param latitude latitude value: must be within standard +/-90 coordinate bounds.
+   * @param longitude longitude value: must be within standard +/-180 coordinate bounds.
+   * @throws IllegalArgumentException if the field name is null or latitude or longitude are out of
+   *     bounds
+   */
+  public LatLonField(String name, double latitude, double longitude) {
+    super(name, TYPE);
+    setLocationValue(latitude, longitude);
+  }
+
+  @Override
+  public String toString() {

Review Comment:
   This just occurred to me, should we also implement `equals` and `hashcode` contracts? Looks like the companion PR didn't do this, and we don't historically implement these contracts, I'm just wondering if we should do our diligence to ensure deep comparisons?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] nknize commented on a diff in pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "nknize (via GitHub)" <gi...@apache.org>.
nknize commented on code in PR #12162:
URL: https://github.com/apache/lucene/pull/12162#discussion_r1114644266


##########
lucene/core/src/java/org/apache/lucene/document/LatLonField.java:
##########
@@ -0,0 +1,318 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.document;
+
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLongitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude;
+
+import java.io.IOException;
+import org.apache.lucene.geo.LatLonGeometry;
+import org.apache.lucene.geo.Point;
+import org.apache.lucene.geo.Polygon;
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.FieldDoc;
+import org.apache.lucene.search.IndexOrDocValuesQuery;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MatchAllDocsQuery;
+import org.apache.lucene.search.MatchNoDocsQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.TopFieldDocs;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.NumericUtils;
+
+/**
+ * An indexed location field for querying and sorting. If you need more fine-grained control you can
+ * use {@link LatLonPoint} and {@link LatLonDocValuesField}.
+ *
+ * <p>Finding all documents within a range at search time is efficient. Multiple values for the same
+ * field in one document is allowed.
+ *
+ * <p>This field defines static factory methods for common operations:
+ *
+ * <ul>
+ *   <li>{@link #newBoxQuery newBoxQuery()} for matching points within a bounding box.
+ *   <li>{@link #newDistanceQuery newDistanceQuery()} for matching points within a specified
+ *       distance.
+ *   <li>{@link #newPolygonQuery newPolygonQuery()} for matching points within an arbitrary polygon.
+ *   <li>{@link #newGeometryQuery newGeometryQuery()} for matching points complying with a spatial
+ *       relationship with an arbitrary geometry.
+ *   <li>{@link #newDistanceFeatureQuery newDistanceFeatureQuery()} for returning points scored by
+ *       distance to a specified location.
+ *   <li>{@link #nearest nearest()} for returning the nearest points from a specified location.
+ *   <li>{@link #newDistanceSort newDistanceSort()} for ordering documents by distance from a
+ *       specified location.
+ * </ul>
+ *
+ * <p>If you also need to store the value, you should add a separate {@link StoredField} instance.
+ *
+ * <p><b>WARNING</b>: Values are indexed with some loss of precision from the original {@code
+ * double} values (4.190951585769653E-8 for the latitude component and 8.381903171539307E-8 for
+ * longitude).
+ *
+ * @see LatLonPoint
+ * @see LatLonDocValuesField
+ */
+public class LatLonField extends Field {

Review Comment:
   These class names are getting super inconsistent. Since this targets points can we refactor this to `LatLonPointField` so as to not confuse general `LatLonField` w/ `ShapeField` w/ `LatLonShape` etc? I think this also makes it more consistent w/ `LatLonPointSortField`. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] jpountz commented on a diff in pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "jpountz (via GitHub)" <gi...@apache.org>.
jpountz commented on code in PR #12162:
URL: https://github.com/apache/lucene/pull/12162#discussion_r1112997446


##########
lucene/CHANGES.txt:
##########
@@ -112,6 +112,9 @@ API Changes
 * GITHUB#12129: Move DocValuesTermsQuery from sandbox to SortedDocValuesField#newSlowSetQuery
   and SortedSetDocValuesField#newSlowSetQuery. (Robert Muir)
 
+* GITHUB#12161: Introduce LatLonField which ndex both LatLonField and LatLonDDocValues.

Review Comment:
   ```suggestion
   * GITHUB#12161: Introduce LatLonField which indexes both LatLonPoint and LatLonDocValuesField.
   ```



##########
lucene/core/src/java/org/apache/lucene/document/LatLonField.java:
##########
@@ -0,0 +1,297 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.document;
+
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLongitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude;
+
+import java.io.IOException;
+import org.apache.lucene.geo.LatLonGeometry;
+import org.apache.lucene.geo.Polygon;
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.FieldDoc;
+import org.apache.lucene.search.IndexOrDocValuesQuery;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MatchAllDocsQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.TopFieldDocs;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.NumericUtils;
+
+/**
+ * An indexed location field for querying and sorting. If you need more fine-grained control you can
+ * use {@link LatLonPoint} and {@link LatLonDocValuesField}.
+ *
+ * <p>Finding all documents within a range at search time is efficient. Multiple values for the same
+ * field in one document is allowed.
+ *
+ * <p>This field defines static factory methods for common operations:
+ *
+ * <ul>
+ *   <li>{@link #newGeometryQuery newGeometryQuery()} for matching points complying with a spatial
+ *       relationship with an arbitrary geometry.
+ *   <li>{@link #newDistanceFeatureQuery newDistanceFeatureQuery()} for returning points scored by
+ *       distance to a specified location.
+ *   <li>{@link #nearest nearest()} for returning the nearest points from a specified location.
+ *   <li>{@link #newDistanceSort newDistanceSort()} for ordering documents by distance from a
+ *       specified location.

Review Comment:
   Mention the box and polygon queries too?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] jpountz commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "jpountz (via GitHub)" <gi...@apache.org>.
jpountz commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1446752140

   I agree we should have better ways to help users store these richer types, though ideally I'd like it to not fiddle with formatting, which feels like it may be a can of worms? Thinking out loud, what about storing the data with the same rounding that we enforce for the KD index and doc values, store lat/lon points as longs, and introduce helper methods to deal with stored data like we do for queries? E.g. something like `Point LatLonField#decode(long storedValue)`. Shapes could do something similar, e.g. `LatLonGeometry decode(BytesRef storedValue)`?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] jpountz commented on a diff in pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "jpountz (via GitHub)" <gi...@apache.org>.
jpountz commented on code in PR #12162:
URL: https://github.com/apache/lucene/pull/12162#discussion_r1119110761


##########
lucene/core/src/java/org/apache/lucene/document/LatLonField.java:
##########
@@ -0,0 +1,318 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.document;
+
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLongitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude;
+
+import java.io.IOException;
+import org.apache.lucene.geo.LatLonGeometry;
+import org.apache.lucene.geo.Point;
+import org.apache.lucene.geo.Polygon;
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.FieldDoc;
+import org.apache.lucene.search.IndexOrDocValuesQuery;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MatchAllDocsQuery;
+import org.apache.lucene.search.MatchNoDocsQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.TopFieldDocs;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.NumericUtils;
+
+/**
+ * An indexed location field for querying and sorting. If you need more fine-grained control you can
+ * use {@link LatLonPoint} and {@link LatLonDocValuesField}.
+ *
+ * <p>Finding all documents within a range at search time is efficient. Multiple values for the same
+ * field in one document is allowed.
+ *
+ * <p>This field defines static factory methods for common operations:
+ *
+ * <ul>
+ *   <li>{@link #newBoxQuery newBoxQuery()} for matching points within a bounding box.
+ *   <li>{@link #newDistanceQuery newDistanceQuery()} for matching points within a specified
+ *       distance.
+ *   <li>{@link #newPolygonQuery newPolygonQuery()} for matching points within an arbitrary polygon.
+ *   <li>{@link #newGeometryQuery newGeometryQuery()} for matching points complying with a spatial
+ *       relationship with an arbitrary geometry.
+ *   <li>{@link #newDistanceFeatureQuery newDistanceFeatureQuery()} for returning points scored by
+ *       distance to a specified location.
+ *   <li>{@link #nearest nearest()} for returning the nearest points from a specified location.
+ *   <li>{@link #newDistanceSort newDistanceSort()} for ordering documents by distance from a
+ *       specified location.
+ * </ul>
+ *
+ * <p>If you also need to store the value, you should add a separate {@link StoredField} instance.
+ *
+ * <p><b>WARNING</b>: Values are indexed with some loss of precision from the original {@code
+ * double} values (4.190951585769653E-8 for the latitude component and 8.381903171539307E-8 for
+ * longitude).
+ *
+ * @see LatLonPoint
+ * @see LatLonDocValuesField
+ */
+public class LatLonField extends Field {

Review Comment:
   We used `<type>Field` with other types for fields that enable both terms or points, and doc values, e.g. `LongField` or `KeywordField`, so `LatLonField` feels consistent with these existing fields?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] Add LatLonField class to index both LatLonPoint and LatLonDocValues [lucene]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1880903680

   This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] nknize commented on a diff in pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "nknize (via GitHub)" <gi...@apache.org>.
nknize commented on code in PR #12162:
URL: https://github.com/apache/lucene/pull/12162#discussion_r1150921848


##########
lucene/core/src/java/org/apache/lucene/document/LatLonField.java:
##########
@@ -0,0 +1,318 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.document;
+
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLongitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude;
+
+import java.io.IOException;
+import org.apache.lucene.geo.LatLonGeometry;
+import org.apache.lucene.geo.Point;
+import org.apache.lucene.geo.Polygon;
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.FieldDoc;
+import org.apache.lucene.search.IndexOrDocValuesQuery;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MatchAllDocsQuery;
+import org.apache.lucene.search.MatchNoDocsQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.TopFieldDocs;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.NumericUtils;
+
+/**
+ * An indexed location field for querying and sorting. If you need more fine-grained control you can
+ * use {@link LatLonPoint} and {@link LatLonDocValuesField}.
+ *
+ * <p>Finding all documents within a range at search time is efficient. Multiple values for the same
+ * field in one document is allowed.
+ *
+ * <p>This field defines static factory methods for common operations:
+ *
+ * <ul>
+ *   <li>{@link #newBoxQuery newBoxQuery()} for matching points within a bounding box.
+ *   <li>{@link #newDistanceQuery newDistanceQuery()} for matching points within a specified
+ *       distance.
+ *   <li>{@link #newPolygonQuery newPolygonQuery()} for matching points within an arbitrary polygon.
+ *   <li>{@link #newGeometryQuery newGeometryQuery()} for matching points complying with a spatial
+ *       relationship with an arbitrary geometry.
+ *   <li>{@link #newDistanceFeatureQuery newDistanceFeatureQuery()} for returning points scored by
+ *       distance to a specified location.
+ *   <li>{@link #nearest nearest()} for returning the nearest points from a specified location.
+ *   <li>{@link #newDistanceSort newDistanceSort()} for ordering documents by distance from a
+ *       specified location.
+ * </ul>
+ *
+ * <p>If you also need to store the value, you should add a separate {@link StoredField} instance.
+ *
+ * <p><b>WARNING</b>: Values are indexed with some loss of precision from the original {@code
+ * double} values (4.190951585769653E-8 for the latitude component and 8.381903171539307E-8 for
+ * longitude).
+ *
+ * @see LatLonPoint
+ * @see LatLonDocValuesField
+ */
+public class LatLonField extends Field {

Review Comment:
   @jpountz <type>Field is fine... I'm not saying not to name it that.. I'm saying `<type>` should be `LatLonPoint` so it's not misleading users that this field supports both `LatLonPoint` and `LatLonShape`. Because it doesn't.



##########
lucene/core/src/java/org/apache/lucene/document/LatLonField.java:
##########
@@ -0,0 +1,318 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.document;
+
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLongitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude;
+
+import java.io.IOException;
+import org.apache.lucene.geo.LatLonGeometry;
+import org.apache.lucene.geo.Point;
+import org.apache.lucene.geo.Polygon;
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.FieldDoc;
+import org.apache.lucene.search.IndexOrDocValuesQuery;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MatchAllDocsQuery;
+import org.apache.lucene.search.MatchNoDocsQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.TopFieldDocs;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.NumericUtils;
+
+/**
+ * An indexed location field for querying and sorting. If you need more fine-grained control you can
+ * use {@link LatLonPoint} and {@link LatLonDocValuesField}.
+ *
+ * <p>Finding all documents within a range at search time is efficient. Multiple values for the same
+ * field in one document is allowed.
+ *
+ * <p>This field defines static factory methods for common operations:
+ *
+ * <ul>
+ *   <li>{@link #newBoxQuery newBoxQuery()} for matching points within a bounding box.
+ *   <li>{@link #newDistanceQuery newDistanceQuery()} for matching points within a specified
+ *       distance.
+ *   <li>{@link #newPolygonQuery newPolygonQuery()} for matching points within an arbitrary polygon.
+ *   <li>{@link #newGeometryQuery newGeometryQuery()} for matching points complying with a spatial
+ *       relationship with an arbitrary geometry.
+ *   <li>{@link #newDistanceFeatureQuery newDistanceFeatureQuery()} for returning points scored by
+ *       distance to a specified location.
+ *   <li>{@link #nearest nearest()} for returning the nearest points from a specified location.
+ *   <li>{@link #newDistanceSort newDistanceSort()} for ordering documents by distance from a
+ *       specified location.
+ * </ul>
+ *
+ * <p>If you also need to store the value, you should add a separate {@link StoredField} instance.
+ *
+ * <p><b>WARNING</b>: Values are indexed with some loss of precision from the original {@code
+ * double} values (4.190951585769653E-8 for the latitude component and 8.381903171539307E-8 for
+ * longitude).
+ *
+ * @see LatLonPoint
+ * @see LatLonDocValuesField
+ */
+public class LatLonField extends Field {

Review Comment:
   @jpountz <type>Field is fine... I'm not saying not to name it that.. I'm saying `<type>` should = `LatLonPoint` so it's not misleading users that this field supports both `LatLonPoint` and `LatLonShape`. Because it doesn't.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] nknize commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "nknize (via GitHub)" <gi...@apache.org>.
nknize commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1487302810

   > what about storing the data with the same rounding that we enforce for the KD index and doc values
   
   Yes. Exactly what I'm saying w/ my comment `"...This way we could decide to store LatLonPoint as an efficient integer encoded XY long value"`
   
   >  ideally I'd like it to not fiddle with formatting, which feels like it may be a can of worms?
   
   I agree it could be a can of worms but there are ISO standards (geojson, wkt, wkb, geoparquet) the geo industry uses for interoperability and I don't think supporting these standards is a "can of worms"? We can start w/ comma delimited (wait, `x,y` or `y,x` 🤦🏻‍♂️ lol)
   
   > add a Field.Store ctor option like KeywordField that stores the point the same way as doc values when enabled, and add a helper method org.apache.lucene.geo.Point decodeStoredValue(long storedValue) or something similar?
   
   +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] rmuir commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437106577

   and don't forget, newGeometryQuery doesn't "do anything" you cant already do with the simple methods anyway for poinut data. It is 100% useless


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] rmuir commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437105265

   also btw, this API should not exist to support "people developing geo applications" anyway. I could give two shits about "geo nerds".
   
   These point method apis exist to support normal ordinary joe, who builds a search engine, and needs to incorporate basic distance or point-in-polygon into their search.
   
   it is by far the 99.99% use-case of this stuff,  people indexing points and wanting to do basic operations. And this field should reflect this. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] rmuir commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437065088

   I would also suggest removing the newGeometryQuery() method from what should be an easy-to-use field. The api is too insane...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] jpountz commented on a diff in pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "jpountz (via GitHub)" <gi...@apache.org>.
jpountz commented on code in PR #12162:
URL: https://github.com/apache/lucene/pull/12162#discussion_r1119112950


##########
lucene/core/src/java/org/apache/lucene/document/LatLonField.java:
##########
@@ -0,0 +1,318 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.document;
+
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.decodeLongitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude;
+import static org.apache.lucene.geo.GeoEncodingUtils.encodeLongitude;
+
+import java.io.IOException;
+import org.apache.lucene.geo.LatLonGeometry;
+import org.apache.lucene.geo.Point;
+import org.apache.lucene.geo.Polygon;
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.FieldDoc;
+import org.apache.lucene.search.IndexOrDocValuesQuery;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MatchAllDocsQuery;
+import org.apache.lucene.search.MatchNoDocsQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.TopFieldDocs;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.NumericUtils;
+
+/**
+ * An indexed location field for querying and sorting. If you need more fine-grained control you can
+ * use {@link LatLonPoint} and {@link LatLonDocValuesField}.
+ *
+ * <p>Finding all documents within a range at search time is efficient. Multiple values for the same
+ * field in one document is allowed.
+ *
+ * <p>This field defines static factory methods for common operations:
+ *
+ * <ul>
+ *   <li>{@link #newBoxQuery newBoxQuery()} for matching points within a bounding box.
+ *   <li>{@link #newDistanceQuery newDistanceQuery()} for matching points within a specified
+ *       distance.
+ *   <li>{@link #newPolygonQuery newPolygonQuery()} for matching points within an arbitrary polygon.
+ *   <li>{@link #newGeometryQuery newGeometryQuery()} for matching points complying with a spatial
+ *       relationship with an arbitrary geometry.
+ *   <li>{@link #newDistanceFeatureQuery newDistanceFeatureQuery()} for returning points scored by
+ *       distance to a specified location.
+ *   <li>{@link #nearest nearest()} for returning the nearest points from a specified location.
+ *   <li>{@link #newDistanceSort newDistanceSort()} for ordering documents by distance from a
+ *       specified location.
+ * </ul>
+ *
+ * <p>If you also need to store the value, you should add a separate {@link StoredField} instance.
+ *
+ * <p><b>WARNING</b>: Values are indexed with some loss of precision from the original {@code
+ * double} values (4.190951585769653E-8 for the latitude component and 8.381903171539307E-8 for
+ * longitude).
+ *
+ * @see LatLonPoint
+ * @see LatLonDocValuesField
+ */
+public class LatLonField extends Field {
+  /** LatLonPoint is encoded as integer values so number of bytes is 4 */
+  public static final int BYTES = Integer.BYTES;
+  /**
+   * Type for an indexed LatLonPoint
+   *
+   * <p>Each point stores two dimensions with 4 bytes per dimension.
+   */
+  public static final FieldType TYPE = new FieldType();
+
+  static {
+    TYPE.setDimensions(2, Integer.BYTES);
+    TYPE.setDocValuesType(DocValuesType.SORTED_NUMERIC);
+    TYPE.freeze();
+  }
+
+  // holds the doc value value.
+  private long docValue;
+
+  /**
+   * Change the values of this field
+   *
+   * @param latitude latitude value: must be within standard +/-90 coordinate bounds.
+   * @param longitude longitude value: must be within standard +/-180 coordinate bounds.
+   * @throws IllegalArgumentException if latitude or longitude are out of bounds
+   */
+  public void setLocationValue(double latitude, double longitude) {
+    final byte[] bytes;
+
+    if (fieldsData == null) {
+      bytes = new byte[8];
+      fieldsData = new BytesRef(bytes);
+    } else {
+      bytes = ((BytesRef) fieldsData).bytes;
+    }
+
+    int latitudeEncoded = encodeLatitude(latitude);
+    int longitudeEncoded = encodeLongitude(longitude);
+    NumericUtils.intToSortableBytes(latitudeEncoded, bytes, 0);
+    NumericUtils.intToSortableBytes(longitudeEncoded, bytes, Integer.BYTES);
+    docValue = Long.valueOf((((long) latitudeEncoded) << 32) | (longitudeEncoded & 0xFFFFFFFFL));
+  }
+
+  @Override
+  public Number numericValue() {
+    return docValue;
+  }
+
+  /**
+   * Creates a new LatLonPoint with the specified latitude and longitude
+   *
+   * @param name field name
+   * @param latitude latitude value: must be within standard +/-90 coordinate bounds.
+   * @param longitude longitude value: must be within standard +/-180 coordinate bounds.
+   * @throws IllegalArgumentException if the field name is null or latitude or longitude are out of
+   *     bounds
+   */
+  public LatLonField(String name, double latitude, double longitude) {
+    super(name, TYPE);
+    setLocationValue(latitude, longitude);
+  }
+
+  @Override
+  public String toString() {

Review Comment:
   These are not meant to be used as value classes, so I'd rather not.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] rmuir commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437108733

   -1 for removing a method that does nothing and has no value? :) 
   
   Dude you have lost your mind! I recommend a psychiatrist!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] iverase commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "iverase (via GitHub)" <gi...@apache.org>.
iverase commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437192476

   LOL it is impossible to disagree with you and not get insulted


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] MarcusSorealheis commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "MarcusSorealheis (via GitHub)" <gi...@apache.org>.
MarcusSorealheis commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437925210

   I've been doing some research and hope MongoDB can help make an impact here soon for all of our customers. However, not speaking for MongoDB and only for myself, I want to weigh in on this conversation for three reasons in the hope that we can eventually figure this one out:
   
   1. @rmuir is one of my heroes(yea, I'm a nerd) and I depended immensely on code he wrote or mentored when I was trying to pull myself up out of poverty with free, open source NoSQLs.  
   
   2. @iverase is such an important and valuable member of the community, and the work he has been doing in the past few years has been good for Lucene's continued success and I appreciate it. 
   
   3. Although I admit to not knowing much, I have my own technical point of view on `newGeometryQuery` that I hope can inform the discussion. Given the fact that I am inclined to be pro (non-binding) the direction, I will start with my opinion of cons, and follow up with pros.
   
   Cons:
   
   - The name is not completely self-evident of the method's function. While it does conform to a pattern used in Lucene over many years to create a static factory method for creating query objects, I wonder if there is a better way than how it's been done. I don't think we should keep calling these things `new` in perpetuity unless they do some really new stuff. It's been years. Such a discussion is probably out of scope for this PR, but I wanted to raise it in case the name I hate is part of the averse reaction from @rmuir. 
   
   - As @rmuir said, it doesn't really do anything. I'm generally an advocating of not adding code that doesn't do anything unless it improves maintainability or modularity. It's one of the reasons I have not proposed much to Lucene.
   
   Pros:
   
   - This factory method requires slightly less code. Although some places look like two lines, that's only because of formatting best practices. The benefits are clearer when stacked as they are in the diff:
   
   | Version | Query|
   | --- | --- |
   | PR | `return newGeometryQuery(field, queryRelation, Arrays.stream(polygons).toArray(Polygon[]::new));` | 
   | Main | `return LatLonPoint.newGeometryQuery(field, queryRelation, Arrays.stream(polygons).toArray(Polygon[]::new));`|
   
   - The method potentially decouples client code from the implementation. That's important because new relations and new geometries could emerge. I don't know what they would possibly be as of writing this comment. I will read up on that. 
   
   - `newGeometryQuery()`'s primary responsibility is to create and return an object (`Query`). However, theoretically, it could be modified in the future to do more generic work to enhance geometric queries provided it was safe. I think that's a reach pro more than anything.
   
   - It's consistent. 
   
   I'm also working on being more of a peacemaker in technical discussions than a tree shaker. A few too many coconuts popped me in the head. 
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] rmuir commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1438418170

   major problem with newGeometryQuery is that, people think it is some universal language to speak across points and shapes.
   
   its not.
   
   points are infinitely small and have no "mass": the relationships here make no sense for them.
   
   the API is bad and we must stop proliferation of it for points. I don't care about use of it for shapes since only 0.001% of users give a crap about shapes, but we can't let points get corrupted by these horrible apis.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] iverase commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "iverase (via GitHub)" <gi...@apache.org>.
iverase commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437092325

   Sorry but I totally disagree, this is the most typical API for a geo application so if someone else struggle with it then it should not be developing a geo application. 
   Anyway I don't care about those methods so I have added them if it makes the PR moves forward.
   
   -1 for removing newGeometryQuery(), this allows to use LatLonShape and LatLonPoint under a common API. This is the only method I care for, so sorry no removing it please.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] rmuir commented on pull request #12162: Add LatLonField class to index both LatLonPoint and LatLonDocValues

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #12162:
URL: https://github.com/apache/lucene/pull/12162#issuecomment-1437079826

   in short: just the combination of methods from LatLonPoint + LatLonDocValuesField, minus the useless and overcomplicated geometry one, that provides no real benefits to point data:
   
   * newBoxQuery()
   * newPolygonQuery()
   * newDistanceQuery()
   * newDistanceFeatureQuery()
   * newDistanceSort()
   * nearest()
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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