shubhamvishu commented on code in PR #16092:
URL: https://github.com/apache/lucene/pull/16092#discussion_r3336255930
##########
lucene/core/src/java/org/apache/lucene/codecs/lucene104/Lucene104ScalarQuantizedVectorsReader.java:
##########
@@ -212,7 +236,22 @@ public RandomVectorScorer getRandomVectorScorer(String
field, float[] target) th
fi.vectorDataOffset,
fi.vectorDataLength,
quantizedVectorData),
- target);
+ scoringTarget);
+ }
+
+ private HadamardRotation rotationFor(String field, int dimension) {
+ return rotations.computeIfAbsent(
+ field,
+ f ->
+ HadamardRotation.create(
+ dimension,
Lucene104ScalarQuantizedVectorsFormat.rotationSeed(f)));
+ }
+
+ private boolean isRotationEnabled(String field) {
Review Comment:
+1 I too love the idea @kaivalnp. I like the part of any knn vector format
should be able to integrate rotation without extra wiring or duplication. I
added a `RotationAwareKnnVectorsFormat` which pretty much does this now
(rotated the vectors when indexing and provides rotated/unrotated views of it
at read time accordingly). I confirmed with a luceneutil the recall improvement
still holds confirming it works as expected(similar to earlier approach).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]