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


##########
lucene/core/src/java/org/apache/lucene/index/FieldInfos.java:
##########
@@ -178,7 +179,15 @@ public static FieldInfos getMergedFieldInfos(IndexReader 
reader) {
               .filter(Objects::nonNull)
               .findAny()
               .orElse(null);
-      final Builder builder = new Builder(new FieldNumbers(softDeletesField));
+      final int indexCreatedVersionMajor =
+          leaves.stream()
+              .map(l -> l.reader().getMetaData())
+              .filter(Objects::nonNull)
+              .mapToInt(r -> r.getCreatedVersionMajor())
+              .min()
+              .orElse(Version.LATEST.major);

Review Comment:
   I am interested when it is possible for segments to have different 
`getCreatedVersionMajor()`?  Looking at the 
[code](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java#L1125)
 of `IndexWriter` it looks like if we open an `IndexWriter` for append, new 
segments will always have the same `indexCreatedVersionMajor` as previous 
segments? 



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