File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
server/src/main/java/org/elasticsearch/index/mapper Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1515import org .elasticsearch .cluster .metadata .IndexMetadata ;
1616import org .elasticsearch .common .settings .Setting ;
1717import org .elasticsearch .common .settings .Settings ;
18+ import org .elasticsearch .index .IndexVersion ;
1819import org .elasticsearch .index .IndexVersions ;
1920import org .elasticsearch .index .query .SearchExecutionContext ;
2021
@@ -35,7 +36,12 @@ public abstract class InferenceMetadataFieldsMapper extends MetadataFieldMapper
3536 */
3637 public static final Setting <Boolean > USE_LEGACY_SEMANTIC_TEXT_FORMAT = Setting .boolSetting (
3738 "index.mapping.semantic_text.use_legacy_format" ,
38- false ,
39+ s -> {
40+ // Check index version SOURCE_MAPPER_MODE_ATTRIBUTE_NOOP because that index version was added in the same serverless promotion
41+ // where the new format was enabled by default
42+ IndexVersion indexVersion = IndexMetadata .SETTING_INDEX_VERSION_CREATED .get (s );
43+ return Boolean .toString (indexVersion .before (IndexVersions .SOURCE_MAPPER_MODE_ATTRIBUTE_NOOP ));
44+ },
3945 Setting .Property .Final ,
4046 Setting .Property .IndexScope ,
4147 Setting .Property .InternalIndex
You can’t perform that action at this time.
0 commit comments