You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by be...@apache.org on 2024/10/24 13:50:09 UTC

(lucene) branch branch_9_12 updated: Fix ord-to-doc mapping when searching Lucene 9.0.0 hnsw indices (#13947)

This is an automated email from the ASF dual-hosted git repository.

benwtrent pushed a commit to branch branch_9_12
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_9_12 by this push:
     new 5a2c28826a6 Fix ord-to-doc mapping when searching Lucene 9.0.0 hnsw indices (#13947)
5a2c28826a6 is described below

commit 5a2c28826a6a8951ea10a28780ab95a79ed70d11
Author: Benjamin Trent <be...@gmail.com>
AuthorDate: Thu Oct 24 09:50:03 2024 -0400

    Fix ord-to-doc mapping when searching Lucene 9.0.0 hnsw indices (#13947)
    
    * Fix ord-to-doc mapping when searching Lucene 9.0.0 hnsw indices
    
    * add changes
---
 lucene/CHANGES.txt                                                     | 3 ++-
 .../lucene/backward_codecs/lucene90/Lucene90HnswVectorsReader.java     | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 27468ecb15c..08230cd4e33 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -7,7 +7,8 @@ http://s.apache.org/luceneversions
 
 Bug Fixes
 ---------------------
-(No changes)
+
+* GITHUB#13947: Fix ord-to-doc mapping when searching Lucene 9.0.0 hnsw indices (Michael Sokolov, Ben Trent)
 
 ======================== Lucene 9.12.0 =======================
 
diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswVectorsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswVectorsReader.java
index 4ee841656ba..945dccb59fc 100644
--- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswVectorsReader.java
+++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswVectorsReader.java
@@ -276,7 +276,7 @@ public final class Lucene90HnswVectorsReader extends KnnVectorsReader {
       int node = results.topNode();
       float minSimilarity = results.topScore();
       results.pop();
-      knnCollector.collect(node, minSimilarity);
+      knnCollector.collect(vectorValues.ordToDoc(node), minSimilarity);
     }
   }