Skip to content

Commit af335b1

Browse files
fix: include check on index version
1 parent 30f7b33 commit af335b1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server/src/main/java/org/elasticsearch/index/mapper/MapperService.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.index.IndexMode;
2828
import org.elasticsearch.index.IndexSettings;
2929
import org.elasticsearch.index.IndexVersion;
30+
import org.elasticsearch.index.IndexVersions;
3031
import org.elasticsearch.index.analysis.AnalysisRegistry;
3132
import org.elasticsearch.index.analysis.IndexAnalyzers;
3233
import org.elasticsearch.index.analysis.NamedAnalyzer;
@@ -129,7 +130,12 @@ public boolean isAutoUpdate() {
129130
);
130131
public static final Setting<Boolean> INDEX_MAPPING_IGNORE_DYNAMIC_BEYOND_LIMIT_SETTING = Setting.boolSetting(
131132
"index.mapping.total_fields.ignore_dynamic_beyond_limit",
132-
settings -> String.valueOf(IndexSettings.MODE.get(settings) == IndexMode.LOGSDB),
133+
settings -> {
134+
boolean isLogsDBIndexMode = IndexSettings.MODE.get(settings) == IndexMode.LOGSDB;
135+
boolean isNewIndexVersion = IndexMetadata.SETTING_INDEX_VERSION_CREATED.get(settings)
136+
.onOrAfter(IndexVersions.LOGSDB_DEFAULT_IGNORE_DYNAMIC_BEYOND_LIMIT);
137+
return String.valueOf(isLogsDBIndexMode && isNewIndexVersion);
138+
},
133139
Property.Dynamic,
134140
Property.IndexScope,
135141
Property.ServerlessPublic

0 commit comments

Comments
 (0)