Support older postings formats#85303
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
Pinging @elastic/es-search (Team:Search) |
dnhatn
left a comment
There was a problem hiding this comment.
I left some minor comments. This looks great. Thanks Yannick!
libs/core/src/main/java/org/elasticsearch/core/internal/io/IOUtils.java
Outdated
Show resolved
Hide resolved
.../repository-old-versions/src/test/java/org/elasticsearch/oldrepos/OldRepositoryAccessIT.java
Outdated
Show resolved
Hide resolved
| if (suffix == null) { | ||
| throw new IllegalStateException("missing attribute: " + PER_FIELD_SUFFIX_KEY + " for field: " + fieldName); | ||
| } | ||
| PostingsFormat format = legacyAdaptingPerFieldPostingsFormat.getPostingsFormat(formatName); |
There was a problem hiding this comment.
I think we introduced this adapter because of line 125? I tried to remove this class by converting the PerFieldPostingsFormat.format attribute from Lucene50 to BWCLucene50 in FieldInfos, but it didn't work because of line 126. I think it's fine to have this class.
There was a problem hiding this comment.
Another motivation for this class is that it keeps the information in these older indices as much "as-is" as possible, not requiring a conversion step before reading. Furthermore, future versions won't have to be aware that that conversion step happened in some prior versions of archive, if we were to remove it e.g. in the future. The nice bit is that this conversion can go away in ES 9 as we won't have a conflicting Lucene50PostingsFormat shipped anymore as part of bwc jars.
Adds support for the Lucene 5 postings format (used by Lucene 6 and 7).
Relates #81210