LuXugang commented on code in PR #792:
URL: https://github.com/apache/lucene/pull/792#discussion_r862373384


##########
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:
   `OffHeapVectorValues` was used in 
`Lucene91HnswVectorsWriter#writeField(...)` which `FieldEntry`  is not existed. 
   
   I had to do it base on the least changes.
   



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

Reply via email to