alessandrobenedetti commented on code in PR #12314:
URL: https://github.com/apache/lucene/pull/12314#discussion_r1243704603


##########
lucene/core/src/java/org/apache/lucene/search/VectorScorer.java:
##########
@@ -85,6 +96,26 @@ public boolean advanceExact(int doc) throws IOException {
       return vectorDoc == doc;
     }
 
+    @Override
+    public Map<Integer, Float> scoreMultiValued(BitSet acceptedDocs) throws 
IOException {
+      Map<Integer, Float> docToScore = new HashMap<>();
+      for (int vectorId = values.nextDoc(); vectorId != NO_MORE_DOCS; vectorId 
= values.nextDoc()) {
+        int docID = values.ordToDoc(vectorId);
+        if (acceptedDocs.get(docID)) {
+          float currentScore = similarity.compare(query, values.vectorValue());
+          docToScore.putIfAbsent(docID, currentScore);
+          docToScore.computeIfPresent(docID,
+                  (key, previousScore) -> Math.max(previousScore, 
currentScore));
+        }
+      }
+      return docToScore;
+    }

Review Comment:
   Yep, didn't spend much time on this, I drafted a few lines of code just to 
make the exact search tests green.
   Happy to get suggestions/other people implementations here!
   



-- 
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