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


##########
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've checked and even if we force merge an older index, its new segment will 
still have metadata `getCreatedVersionMajor()` of older version, so we are good 
here. 



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