Skip to content

Commit 4e6265f

Browse files
committed
add index version check
1 parent bbee160 commit 4e6265f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

server/src/main/java/org/elasticsearch/index/IndexVersions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ private static Version parseUnchecked(String version) {
147147
public static final IndexVersion UPGRADE_TO_LUCENE_10_1_0 = def(9_009_0_00, Version.LUCENE_10_1_0);
148148
public static final IndexVersion USE_SYNTHETIC_SOURCE_FOR_RECOVERY_BY_DEFAULT = def(9_010_00_0, Version.LUCENE_10_1_0);
149149
public static final IndexVersion TIMESTAMP_DOC_VALUES_SPARSE_INDEX = def(9_011_0_00, Version.LUCENE_10_1_0);
150+
public static final IndexVersion SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_KEYWORD = def(9_012_0_00, Version.LUCENE_10_1_0);
150151
/*
151152
* STOP! READ THIS FIRST! No, really,
152153
* ____ _____ ___ ____ _ ____ _____ _ ____ _____ _ _ ___ ____ _____ ___ ____ ____ _____ _

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@ public KeywordFieldMapper build(MapperBuilderContext context) {
446446
&& hasDocValues()
447447
&& fieldtype.stored() == false
448448
&& copyTo.copyToFields().isEmpty()
449-
&& multiFieldsBuilder.hasMultiFields() == false) {
449+
&& multiFieldsBuilder.hasMultiFields() == false
450+
&& indexCreatedVersion.onOrAfter(IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_KEYWORD)) {
450451
// Skip stored, we will be synthesizing from stored fields, no point to keep track of the offsets
451452
// Skip copy_to and multi fields, supporting that requires more work. However, copy_to usage is rare in metrics and
452453
// logging use cases

0 commit comments

Comments
 (0)