msokolov commented on code in PR #13872:
URL: https://github.com/apache/lucene/pull/13872#discussion_r1811235616


##########
lucene/core/src/java/org/apache/lucene/codecs/hnsw/DefaultFlatVectorScorer.java:
##########
@@ -88,34 +88,28 @@ public String toString() {
 
   /** RandomVectorScorerSupplier for bytes vector */
   private static final class ByteScoringSupplier implements 
RandomVectorScorerSupplier {
-    private final ByteVectorValues vectors;
-    private final ByteVectorValues vectors1;
-    private final ByteVectorValues vectors2;
+    private final ByteVectorValues vectorValues;
     private final VectorSimilarityFunction similarityFunction;
 
     private ByteScoringSupplier(
-        ByteVectorValues vectors, VectorSimilarityFunction similarityFunction) 
throws IOException {
-      this.vectors = vectors;
-      vectors1 = vectors.copy();
-      vectors2 = vectors.copy();
+        ByteVectorValues vectorValues, VectorSimilarityFunction 
similarityFunction)
+        throws IOException {
+      this.vectorValues = vectorValues;
       this.similarityFunction = similarityFunction;
     }
 
     @Override
-    public RandomVectorScorer scorer(int ord) {
-      return new RandomVectorScorer.AbstractRandomVectorScorer(vectors) {
+    public RandomVectorScorer scorer(int ord) throws IOException {
+      ByteVectorValues.Bytes vectors1 = vectorValues.vectors();
+      ByteVectorValues.Bytes vectors2 = vectorValues.vectors();
+      return new RandomVectorScorer.AbstractRandomVectorScorer(vectorValues) {

Review Comment:
   yeah this seems like a bad consequence. Maybe we could switch from a 
supplier/scorer to a mutable scorer that can be "set" to a new vector as needed?



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to