s1monw commented on code in PR #12829: URL: https://github.com/apache/lucene/pull/12829#discussion_r1434189939
########## lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java: ########## @@ -262,6 +294,35 @@ long updateDocuments( } } + private Iterable<? extends IndexableField> addParentField( + Iterable<? extends IndexableField> doc, IndexableField parentField) { + return () -> { + final Iterator<? extends IndexableField> first = doc.iterator(); + return new Iterator<>() { + IndexableField additionalField = parentField; + + @Override + public boolean hasNext() { + return first.hasNext() || additionalField != null; + } + + @Override + public IndexableField next() { + if (first.hasNext()) { + IndexableField field = first.next(); + return field; + } + if (additionalField != null) { + IndexableField field = additionalField; + additionalField = null; + return field; Review Comment: sure lemme do that -- 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