[
https://issues.apache.org/jira/browse/LUCENE-6492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14552280#comment-14552280
]
David Smiley commented on LUCENE-6492:
--------------------------------------
For common cases this is aimed at. I think we should assume you're indexing
point data, and as-such the "predicate" (e.g. intersects, within, etc.) is
irrelevant.
There's basically three methods to concern ourselves with.
For indexing:
{code:java}
public abstract Field[] createIndexableFields(Shape shape);
{code}
Since we can only index a point in the simple case, this parameters simply
becomes {{float x, float y}}.
For search:
{code:java}
public abstract Query makeQuery(SpatialArgs args);
{code}
SpatialArgs is basically a wrapper around both a shape and predicate. The
shape could be a rectangle, or point-radius circle, or in more advanced cases
something like a polygon. We could overload makeQuery to at a minimum take the
rectangle and circle case. The rectangle would simply be the 4 edges, and
the circle would be an x,y point and a distance radius. I consider polygons to
be an advanced case because so few spatial use-cases require it.
For distance sort/boost:
{code:java}
public abstract ValueSource makeDistanceValueSource(Point queryPoint, double
multiplier);
{code}
queryPoint could simply become float x, float y.
Thoughts?
> New SpatialStrategy abstraction that doesn't require Spatial4j
> --------------------------------------------------------------
>
> Key: LUCENE-6492
> URL: https://issues.apache.org/jira/browse/LUCENE-6492
> Project: Lucene - Core
> Issue Type: Improvement
> Components: modules/spatial
> Reporter: David Smiley
>
> This issue is about coming up with a new (or updated) SpatialStrategy
> abstraction. The primary goal is to remove a dependency on Spatial4j. Some
> SpatialStrategies will not use/require the abstractions in Spatial4j.
> Strategies that support more complex/interesting cases may require Spatial4j
> still.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]