1010package org .elasticsearch .index .codec ;
1111
1212import org .apache .lucene .codecs .PostingsFormat ;
13+ import org .apache .lucene .codecs .lucene101 .Lucene101PostingsFormat ;
1314import org .elasticsearch .cluster .metadata .IndexMetadata ;
1415import org .elasticsearch .common .compress .CompressedXContent ;
1516import org .elasticsearch .common .settings .Settings ;
@@ -93,7 +94,8 @@ public void testUseBloomFilter() throws IOException {
9394 assertThat (perFieldMapperCodec .getPostingsFormatForField ("_id" ), instanceOf (ES87BloomFilterPostingsFormat .class ));
9495 assertThat (perFieldMapperCodec .useBloomFilter ("another_field" ), is (false ));
9596
96- Class <? extends PostingsFormat > expectedPostingsFormat = ES812PostingsFormat .class ;
97+ Class <? extends PostingsFormat > expectedPostingsFormat = PerFieldFormatSupplier .USE_DEFAULT_LUCENE_POSTINGS_FORMAT .isEnabled ()
98+ && timeSeries == false ? Lucene101PostingsFormat .class : ES812PostingsFormat .class ;
9799 assertThat (perFieldMapperCodec .getPostingsFormatForField ("another_field" ), instanceOf (expectedPostingsFormat ));
98100 }
99101
@@ -108,7 +110,9 @@ public void testUseBloomFilterWithTimestampFieldEnabled() throws IOException {
108110 public void testUseBloomFilterWithTimestampFieldEnabled_noTimeSeriesMode () throws IOException {
109111 PerFieldFormatSupplier perFieldMapperCodec = createFormatSupplier (true , false , false );
110112 assertThat (perFieldMapperCodec .useBloomFilter ("_id" ), is (false ));
111- Class <? extends PostingsFormat > expectedPostingsFormat = ES812PostingsFormat .class ;
113+ Class <? extends PostingsFormat > expectedPostingsFormat = PerFieldFormatSupplier .USE_DEFAULT_LUCENE_POSTINGS_FORMAT .isEnabled ()
114+ ? Lucene101PostingsFormat .class
115+ : ES812PostingsFormat .class ;
112116 assertThat (perFieldMapperCodec .getPostingsFormatForField ("_id" ), instanceOf (expectedPostingsFormat ));
113117 }
114118
0 commit comments