diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 11fa354e4c68..5cbec01f8cc9 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -107,7 +107,7 @@ API Changes * GITHUB#11761: TieredMergePolicy now allowed a maximum allowable deletes percentage of down to 5%, and the default maximum allowable deletes percentage is changed from 33% to 20%. (Marc D'Mello) - + * GITHUB#11822: Configure replicator PrimaryNode replia shutdown timeout. (Steven Schlansker) New Features @@ -168,6 +168,8 @@ Other * LUCENE-10635: Ensure test coverage for WANDScorer by using a test query. (Zach Chen, Adrien Grand) +* GITHUB#11752: Added interface to relate a LatLonShape with another shape represented as Component2D. (Navneet Verma) + Build --------------------- diff --git a/lucene/core/src/java/org/apache/lucene/document/LatLonShape.java b/lucene/core/src/java/org/apache/lucene/document/LatLonShape.java index d749b7c52b50..f99b699565bd 100644 --- a/lucene/core/src/java/org/apache/lucene/document/LatLonShape.java +++ b/lucene/core/src/java/org/apache/lucene/document/LatLonShape.java @@ -66,6 +66,7 @@ * QueryRelation} with a polygon. *
  • {@link #newGeometryQuery newGeometryQuery()} for matching geo shapes that have some {@link * QueryRelation} with one or more {@link LatLonGeometry}. + *
  • {@link #createLatLonShapeDocValues(BytesRef)} for creating the {@link LatLonShapeDocValues} * * * WARNING: Like {@link LatLonPoint}, vertex values are indexed with some loss of precision @@ -341,6 +342,16 @@ public static Query newGeometryQuery( } } + /** + * Factory method for creating the {@link LatLonShapeDocValues} + * + * @param bytesRef {@link BytesRef} + * @return {@link LatLonShapeDocValues} + */ + public static LatLonShapeDocValues createLatLonShapeDocValues(BytesRef bytesRef) { + return new LatLonShapeDocValues(bytesRef); + } + private static Query makeContainsGeometryQuery(String field, LatLonGeometry... latLonGeometries) { BooleanQuery.Builder builder = new BooleanQuery.Builder(); for (LatLonGeometry geometry : latLonGeometries) { diff --git a/lucene/core/src/java/org/apache/lucene/document/XYShape.java b/lucene/core/src/java/org/apache/lucene/document/XYShape.java index de648d3ba094..1d871f876afd 100644 --- a/lucene/core/src/java/org/apache/lucene/document/XYShape.java +++ b/lucene/core/src/java/org/apache/lucene/document/XYShape.java @@ -65,6 +65,7 @@ * QueryRelation} with a polygon. *
  • {@link #newGeometryQuery newGeometryQuery()} for matching cartesian shapes that have some * {@link QueryRelation} with one or more {@link XYGeometry}. + *
  • {@link #createXYShapeDocValues(BytesRef)} for creating the {@link XYShapeDocValues} * * * WARNING: Like {@link LatLonPoint}, vertex values are indexed with some loss of precision @@ -269,4 +270,14 @@ public static Query newGeometryQuery( } return new XYShapeQuery(field, queryRelation, xyGeometries); } + + /** + * Factory method for creating the {@link XYShapeDocValues} + * + * @param bytesRef {@link BytesRef} + * @return {@link XYShapeDocValues} + */ + public static XYShapeDocValues createXYShapeDocValues(BytesRef bytesRef) { + return new XYShapeDocValues(bytesRef); + } }