@@ -153,35 +153,27 @@ protected Supplier<ModelRegistry> getModelRegistry() {
153153
154154 private MapperService createMapperService (XContentBuilder mappings , boolean useLegacyFormat ) throws IOException {
155155 IndexVersion indexVersion = SemanticInferenceMetadataFieldsMapperTests .getRandomCompatibleIndexVersion (useLegacyFormat );
156- return createMapperService (mappings , useLegacyFormat , indexVersion , indexVersion , false );
156+ return createMapperService (mappings , useLegacyFormat , indexVersion , indexVersion );
157157 }
158158
159159 private MapperService createMapperService (XContentBuilder mappings , boolean useLegacyFormat , IndexVersion minIndexVersion )
160160 throws IOException {
161- return createMapperService (mappings , useLegacyFormat , minIndexVersion , IndexVersion .current (), false );
161+ return createMapperService (mappings , useLegacyFormat , minIndexVersion , IndexVersion .current ());
162162 }
163163
164164 private MapperService createMapperService (
165165 XContentBuilder mappings ,
166166 boolean useLegacyFormat ,
167167 IndexVersion minIndexVersion ,
168- IndexVersion maxIndexVersion ,
169- boolean propagateIndexVersion
168+ IndexVersion maxIndexVersion
170169 ) throws IOException {
171170 validateIndexVersion (minIndexVersion , useLegacyFormat );
172171 IndexVersion indexVersion = IndexVersionUtils .randomVersionBetween (random (), minIndexVersion , maxIndexVersion );
173172 var settings = Settings .builder ()
174173 .put (IndexMetadata .SETTING_INDEX_VERSION_CREATED .getKey (), indexVersion )
175174 .put (InferenceMetadataFieldsMapper .USE_LEGACY_SEMANTIC_TEXT_FORMAT .getKey (), useLegacyFormat )
176175 .build ();
177- // TODO - This is added, because we discovered a bug where the index version was not being correctly propagated
178- // in our mappings even though we were specifying the index version in settings. We will fix this in a followup and
179- // remove the boolean flag accordingly.
180- if (propagateIndexVersion ) {
181- return createMapperService (indexVersion , settings , mappings );
182- } else {
183- return createMapperService (settings , mappings );
184- }
176+ return createMapperService (indexVersion , settings , mappings );
185177 }
186178
187179 private static void validateIndexVersion (IndexVersion indexVersion , boolean useLegacyFormat ) {
@@ -1187,8 +1179,7 @@ public void testDefaultIndexOptions() throws IOException {
11871179 }),
11881180 useLegacyFormat ,
11891181 IndexVersions .INFERENCE_METADATA_FIELDS_BACKPORT ,
1190- IndexVersionUtils .getPreviousVersion (IndexVersions .SEMANTIC_TEXT_DEFAULTS_TO_BBQ_BACKPORT_8_X ),
1191- true
1182+ IndexVersionUtils .getPreviousVersion (IndexVersions .SEMANTIC_TEXT_DEFAULTS_TO_BBQ_BACKPORT_8_X )
11921183 );
11931184 assertSemanticTextField (mapperService , "field" , true , null , defaultDenseVectorIndexOptions ());
11941185
0 commit comments