@@ -293,12 +293,13 @@ protected void merge(FieldMapper mergeWith, Conflicts conflicts, MapperMergeCont
293293 SemanticTextFieldMapper semanticMergeWith = (SemanticTextFieldMapper ) mergeWith ;
294294 semanticMergeWith = copySettings (semanticMergeWith , mapperMergeContext );
295295
296- super .merge (semanticMergeWith , conflicts , mapperMergeContext );
297- conflicts .check ();
298296 var context = mapperMergeContext .createChildContext (semanticMergeWith .leafName (), ObjectMapper .Dynamic .FALSE );
299297 var inferenceField = inferenceFieldBuilder .apply (context .getMapperBuilderContext ());
300298 var mergedInferenceField = inferenceField .merge (semanticMergeWith .fieldType ().getInferenceField (), context );
301299 inferenceFieldBuilder = c -> mergedInferenceField ;
300+
301+ super .merge (semanticMergeWith , conflicts , mapperMergeContext );
302+ conflicts .check ();
302303 }
303304
304305 /**
@@ -1218,11 +1219,10 @@ static DenseVectorFieldMapper.DenseVectorIndexOptions defaultBbqHnswDenseVectorI
12181219 return new DenseVectorFieldMapper .BBQHnswIndexOptions (m , efConstruction , rescoreVector );
12191220 }
12201221
1221- static SemanticTextIndexOptions defaultBbqHnswSemanticTextIndexOptions (IndexVersion indexVersion ) {
1222+ static SemanticTextIndexOptions defaultBbqHnswSemanticTextIndexOptions () {
12221223 return new SemanticTextIndexOptions (
12231224 SemanticTextIndexOptions .SupportedIndexOptions .DENSE_VECTOR ,
1224- defaultBbqHnswDenseVectorIndexOptions (),
1225- indexVersion
1225+ defaultBbqHnswDenseVectorIndexOptions ()
12261226 );
12271227 }
12281228
@@ -1242,15 +1242,9 @@ private static boolean canMergeIndexOptions(SemanticTextIndexOptions previous, S
12421242 return true ;
12431243 }
12441244
1245- if (previous == null
1246- && current .type () == SemanticTextIndexOptions .SupportedIndexOptions .DENSE_VECTOR
1247- && indexVersionDefaultsToBbqHnsw (current .indexVersion ())) {
1248- return canMergeIndexOptions (defaultBbqHnswSemanticTextIndexOptions (current .indexVersion ()), current , conflicts );
1249- } else if (current == null
1250- && previous .type () == SemanticTextIndexOptions .SupportedIndexOptions .DENSE_VECTOR
1251- && indexVersionDefaultsToBbqHnsw (previous .indexVersion ())) {
1252- return canMergeIndexOptions (previous , defaultBbqHnswSemanticTextIndexOptions (previous .indexVersion ()), conflicts );
1253- }
1245+ if (previous == null || current == null ) {
1246+ return true ;
1247+ }
12541248
12551249 if (previous .type () == SemanticTextIndexOptions .SupportedIndexOptions .DENSE_VECTOR ) {
12561250 DenseVectorFieldMapper .DenseVectorIndexOptions previousDenseOptions = (DenseVectorFieldMapper .DenseVectorIndexOptions ) previous
@@ -1283,10 +1277,6 @@ private static SemanticTextIndexOptions parseIndexOptionsFromMap(String fieldNam
12831277 );
12841278 @ SuppressWarnings ("unchecked" )
12851279 Map <String , Object > indexOptionsMap = (Map <String , Object >) entry .getValue ();
1286- return new SemanticTextIndexOptions (
1287- indexOptions ,
1288- indexOptions .parseIndexOptions (fieldName , indexOptionsMap , indexVersion ),
1289- indexVersion
1290- );
1280+ return new SemanticTextIndexOptions (indexOptions , indexOptions .parseIndexOptions (fieldName , indexOptionsMap , indexVersion ));
12911281 }
12921282}
0 commit comments