Skip to content

Add makeShapeValueSource to SpatialStrategy [LUCENE-5804] #6866

@asfimport

Description

@asfimport

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions