-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LUCENE-9141: Simplify LatLonShapeXQuery API. #1170
Conversation
to support that.
# Conflicts: # lucene/core/src/java/org/apache/lucene/document/LatLonShapeLineQuery.java # lucene/core/src/java/org/apache/lucene/document/LatLonShapePointQuery.java # lucene/core/src/java/org/apache/lucene/document/LatLonShapePolygonQuery.java # lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapeComponent2DQuery.java # lucene/sandbox/src/java/org/apache/lucene/document/LatLonShapePolygonQuery.java
Update the PR by making LatLonGeometry an abstract class so the method that return a Component2D can be made protected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Love the reduction of the three query classes to the single LatLonShapeQuery. Left one question, otherwise it LGTM
|
||
/** create a query to find all indexed geo shapes that intersect a provided geometry collection. | ||
**/ | ||
public static Query newGeometryCollectionQuery(String field, QueryRelation queryRelation, LatLonGeometry... latLonGeometries) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: do you think we could just name this newGeometryQuery
? This way we just treat geometries and single and/or collections? Feels a little less confusing IMHO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it is a better name
…class called LatLonGeometry. (#1170)
This PR tries to simplify the LatLonShape query API. The trick for this simplification is to introduce a new interface called
LatLonGeometry
which is implemented by objects defining queryable geometries, that isPolygon
,Line
and the newly introducedPoint
.The main feature of those geometries is that they can return a
Component2D
object that can be used for query the index.