uschindler commented on code in PR #11999:
URL: https://github.com/apache/lucene/pull/11999#discussion_r1042400407


##########
lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java:
##########
@@ -1797,9 +1825,34 @@ public int maxDoc() {
     }
 
     @Override
-    public void document(int docID, StoredFieldVisitor visitor) {
+    public void document(int docID, StoredFieldVisitor visitor) throws 
IOException {
       if (DEBUG) System.err.println("MemoryIndexReader.document");
-      // no-op: there are no stored fields
+      for (Info info : fields.values()) {
+        StoredFieldVisitor.Status status = visitor.needsField(info.fieldInfo);
+        if (status == StoredFieldVisitor.Status.STOP) {
+          return;
+        }
+        if (status == StoredFieldVisitor.Status.NO) {
+          continue;
+        }
+        if (info.storedValues != null) {
+          for (Object value : info.storedValues) {
+            if (value instanceof BytesRef bytes) {

Review Comment:
   ❤️



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