@@ -97,7 +97,9 @@ public Settings getAdditionalIndexSettings(
9797 ) {
9898 Settings .Builder settingsBuilder = null ;
9999 boolean isLogsDB = templateIndexMode == IndexMode .LOGSDB ;
100- boolean isTemplateValidation = "validate-index-name" .equals (indexName );
100+ // This index name is used when validating component and index templates, we should skip this check in that case.
101+ // (See MetadataIndexTemplateService#validateIndexTemplateV2(...) method)
102+ boolean isTemplateValidation = MetadataIndexTemplateService .VALIDATE_INDEX_NAME .equals (indexName );
101103
102104 // Inject logsdb index mode, based on the logs pattern.
103105 if (isLogsdbEnabled
@@ -113,9 +115,6 @@ && matchesLogsPattern(dataStreamName)) {
113115
114116 // Inject stored source mode if synthetic source if not available per licence.
115117 if (mappingHints .hasSyntheticSourceUsage && supportFallbackToStoredSource .get ()) {
116- // This index name is used when validating component and index templates, we should skip this check in that case.
117- // (See MetadataIndexTemplateService#validateIndexTemplateV2(...) method)
118- boolean isTemplateValidation = MetadataIndexTemplateService .VALIDATE_INDEX_NAME .equals (indexName );
119118 boolean legacyLicensedUsageOfSyntheticSourceAllowed = isLegacyLicensedUsageOfSyntheticSourceAllowed (
120119 templateIndexMode ,
121120 indexName ,
@@ -212,7 +211,7 @@ MappingHints getMappingHints(
212211 Settings indexTemplateAndCreateRequestSettings ,
213212 List <CompressedXContent > combinedTemplateMappings
214213 ) {
215- if ("validate-index-name" .equals (indexName )) {
214+ if (MetadataIndexTemplateService . VALIDATE_INDEX_NAME .equals (indexName )) {
216215 // This index name is used when validating component and index templates, we should skip this check in that case.
217216 // (See MetadataIndexTemplateService#validateIndexTemplateV2(...) method)
218217 return MappingHints .EMPTY ;
0 commit comments