-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
The notion of a ValueSource that yields a Shape from FunctionValues.objectVal(docId) was introduced with SerializedDVStrategy, and I rather like it. I think the base SpatialStrategy abstraction should be amended with it. In addition, a marker class "ShapeValueSource" that simply extends ValueSource would clarify when/where these special value sources are used with a bit of type safety.
/**
* Provides access to a Shape per document via ValueSource in which
* {`@link` org.apache.lucene.queries.function.FunctionValues#objectVal(int)} returns a {`@link`
* Shape}.
*/
public ShapeValueSource makeShapeValueSource() {
throw new UnsupportedOperationException();
}
//(use existing javadocs)
public ValueSource makeDistanceValueSource(Point queryPoint, double multiplier) {
return new DistanceToShapeValueSource(makeShapeValueSource(), queryPoint, multiplier, ctx);
}SerializedDVStrategy & BBoxStrategy would use this; PointVectorStrategy could be modified to.
Migrated from LUCENE-5804 by David Smiley (@dsmiley)
Reactions are currently unavailable