Skip to content

Use native vector scorers when building the HNSW graph #142379

@thecoop

Description

@thecoop

Lucene99 format uses the vector scorer supplier when building the HNSW graph - see https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99HnswVectorsWriter.java#L691. This references the byte/float heap vector directly, which means the native scorers in our supplier implementations can't be used, as they need a MemorySegment from on-disk vectors.

JDK22 supports creating MemorySegments from heap arrays, so we could create a JDK22 version of VectorScorerFactoryImpl that creates memory segments from the byte/float vector values, and uses native code on that.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions