|
17 | 17 | import org.apache.lucene.index.IndexableField; |
18 | 18 | import org.apache.lucene.search.Query; |
19 | 19 | import org.apache.lucene.search.suggest.document.Completion101PostingsFormat; |
20 | | -import org.apache.lucene.search.suggest.document.Completion912PostingsFormat; |
21 | 20 | import org.apache.lucene.search.suggest.document.CompletionAnalyzer; |
22 | 21 | import org.apache.lucene.search.suggest.document.ContextSuggestField; |
23 | 22 | import org.apache.lucene.search.suggest.document.FuzzyCompletionQuery; |
@@ -149,21 +148,19 @@ protected IndexAnalyzers createIndexAnalyzers(IndexSettings indexSettings) { |
149 | 148 | } |
150 | 149 |
|
151 | 150 | public void testPostingsFormat() throws IOException { |
| 151 | + final Class<?> latestLuceneCPClass = Completion101PostingsFormat.class; |
152 | 152 | MapperService mapperService = createMapperService(fieldMapping(this::minimalMapping)); |
153 | 153 | CodecService codecService = new CodecService(mapperService, BigArrays.NON_RECYCLING_INSTANCE); |
154 | 154 | Codec codec = codecService.codec("default"); |
155 | 155 | if (CodecService.ZSTD_STORED_FIELDS_FEATURE_FLAG.isEnabled()) { |
156 | 156 | assertThat(codec, instanceOf(PerFieldMapperCodec.class)); |
157 | | - assertThat(((PerFieldMapperCodec) codec).getPostingsFormatForField("field"), instanceOf(Completion101PostingsFormat.class)); |
| 157 | + assertThat(((PerFieldMapperCodec) codec).getPostingsFormatForField("field"), instanceOf(latestLuceneCPClass)); |
158 | 158 | } else { |
159 | 159 | if (codec instanceof CodecService.DeduplicateFieldInfosCodec deduplicateFieldInfosCodec) { |
160 | 160 | codec = deduplicateFieldInfosCodec.delegate(); |
161 | 161 | } |
162 | 162 | assertThat(codec, instanceOf(LegacyPerFieldMapperCodec.class)); |
163 | | - assertThat( |
164 | | - ((LegacyPerFieldMapperCodec) codec).getPostingsFormatForField("field"), |
165 | | - instanceOf(Completion101PostingsFormat.class) |
166 | | - ); |
| 163 | + assertThat(((LegacyPerFieldMapperCodec) codec).getPostingsFormatForField("field"), instanceOf(latestLuceneCPClass)); |
167 | 164 | } |
168 | 165 | } |
169 | 166 |
|
|
0 commit comments