Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ New Features
`Lucene104HnswScalarQuantizedVectorsFormat(ScalarEncoding.SINGLE_BIT_QUERY_NIBBLE, int, int)`
(Ben Trent)

* GITHUB#15415: Add fallback support to Lucene104ScalarQuantizedVectorsFormat getFloatVectorValues when there are
no full-precision vectors present
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add your name for posterity :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I missed it. Fixed in next revision.


Improvements
---------------------
* GITHUB#15148: Add support uint8 distance and allow 8 bit scalar quantization (Trevor McCulloch)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,23 @@ public FloatVectorValues getFloatVectorValues(String field) throws IOException {
+ " expected: "
+ VectorEncoding.FLOAT32);
}

FloatVectorValues rawFloatVectorValues = rawVectorsReader.getFloatVectorValues(field);

if (rawFloatVectorValues.size() == 0) {
return OffHeapScalarQuantizedFloatVectorValues.load(
fi.ordToDocDISIReaderConfiguration,
fi.dimension,
fi.size,
fi.scalarEncoding,
fi.similarityFunction,
vectorScorer,
fi.centroid,
fi.vectorDataOffset,
fi.vectorDataLength,
quantizedVectorData);
}

OffHeapScalarQuantizedVectorValues sqvv =
OffHeapScalarQuantizedVectorValues.load(
fi.ordToDocDISIReaderConfiguration,
Expand All @@ -224,7 +241,7 @@ public FloatVectorValues getFloatVectorValues(String field) throws IOException {
fi.vectorDataOffset,
fi.vectorDataLength,
quantizedVectorData);
return new ScalarQuantizedVectorValues(rawVectorsReader.getFloatVectorValues(field), sqvv);
return new ScalarQuantizedVectorValues(rawFloatVectorValues, sqvv);
}

@Override
Expand Down
Loading