mayya-sharipova commented on code in PR #792:
URL: https://github.com/apache/lucene/pull/792#discussion_r863189510


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene91/Lucene91HnswVectorsReader.java:
##########
@@ -258,14 +257,18 @@ public TopDocs search(String field, float[] target, int 
k, Bits acceptDocs, int
   }
 
   private OffHeapVectorValues getOffHeapVectorValues(FieldEntry fieldEntry) 
throws IOException {
-    IndexInput bytesSlice =
-        vectorData.slice("vector-data", fieldEntry.vectorDataOffset, 
fieldEntry.vectorDataLength);
-    return new OffHeapVectorValues(
-        fieldEntry.dimension, fieldEntry.size(), fieldEntry.ordToDoc, 
bytesSlice);
+    if (fieldEntry.docsWithFieldOffset == -2) {
+      return 
OffHeapVectorValues.emptyOffHeapVectorValues(fieldEntry.dimension);
+    } else {
+      IndexInput bytesSlice =
+          vectorData.slice("vector-data", fieldEntry.vectorDataOffset, 
fieldEntry.vectorDataLength);
+      return new OffHeapVectorValues(
+          fieldEntry.dimension, fieldEntry.size(), fieldEntry, vectorData, 
bytesSlice);

Review Comment:
   Thanks for explaining, makes sense



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