Skip to content

Commit 9ecd7f0

Browse files
committed
Move setting to MappterService
1 parent 0c52e88 commit 9ecd7f0

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
175175
MapperService.INDEX_MAPPING_DIMENSION_FIELDS_LIMIT_SETTING,
176176
MapperService.INDEX_MAPPING_FIELD_NAME_LENGTH_LIMIT_SETTING,
177177
MapperService.INDEX_MAPPER_DYNAMIC_SETTING,
178+
MapperService.INDEX_MAPPING_META_LENGTH_LIMIT_SETTING,
178179
BitsetFilterCache.INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING,
179180
IndexModule.INDEX_STORE_TYPE_SETTING,
180181
IndexModule.INDEX_STORE_PRE_LOAD_SETTING,
@@ -206,7 +207,7 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
206207
IndexSettings.INDEX_MAPPER_SOURCE_MODE_SETTING,
207208
IndexSettings.RECOVERY_USE_SYNTHETIC_SOURCE_SETTING,
208209
InferenceMetadataFieldsMapper.USE_LEGACY_SEMANTIC_TEXT_FORMAT,
209-
IndexSettings.INDEX_MAPPING_META_LENGTH_LIMIT_SETTING,
210+
// IndexSettings.INDEX_MAPPING_META_LENGTH_LIMIT_SETTING,
210211

211212
// validate that built-in similarities don't get redefined
212213
Setting.groupSetting("index.similarity.", (s) -> {

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -856,14 +856,6 @@ private static String getIgnoreAboveDefaultValue(final Settings settings) {
856856
Property.Final
857857
);
858858

859-
public static final Setting<Integer> INDEX_MAPPING_META_LENGTH_LIMIT_SETTING = Setting.intSetting(
860-
"index.mapping.meta.length_limit",
861-
500,
862-
0,
863-
Property.IndexScope,
864-
Property.Final
865-
);
866-
867859
private final Index index;
868860
private final IndexVersion version;
869861
private final Logger logger;

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ public boolean isAutoUpdate() {
175175
Property.IndexScope,
176176
Property.IndexSettingDeprecatedInV7AndRemovedInV8
177177
);
178+
public static final Setting<Integer> INDEX_MAPPING_META_LENGTH_LIMIT_SETTING = Setting.intSetting(
179+
"index.mapping.meta.length_limit",
180+
500,
181+
0,
182+
Property.IndexScope,
183+
Property.Final
184+
);
178185

179186
private final IndexAnalyzers indexAnalyzers;
180187
private final MappingParser mappingParser;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import static org.elasticsearch.common.xcontent.support.XContentMapValues.isArray;
2626
import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeStringValue;
27-
import static org.elasticsearch.index.IndexSettings.INDEX_MAPPING_META_LENGTH_LIMIT_SETTING;
27+
import static org.elasticsearch.index.mapper.MapperService.INDEX_MAPPING_META_LENGTH_LIMIT_SETTING;
2828

2929
public class TypeParsers {
3030
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(TypeParsers.class);

server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import static org.elasticsearch.index.analysis.AnalysisRegistry.DEFAULT_ANALYZER_NAME;
3939
import static org.elasticsearch.index.analysis.AnalysisRegistry.DEFAULT_SEARCH_ANALYZER_NAME;
4040
import static org.elasticsearch.index.analysis.AnalysisRegistry.DEFAULT_SEARCH_QUOTED_ANALYZER_NAME;
41+
import static org.elasticsearch.index.mapper.MapperService.INDEX_MAPPING_META_LENGTH_LIMIT_SETTING;
4142
import static org.hamcrest.core.IsEqual.equalTo;
4243
import static org.mockito.Mockito.mock;
4344
import static org.mockito.Mockito.when;
@@ -199,7 +200,7 @@ public void testParseMeta() {
199200
.put(IndexMetadata.SETTING_VERSION_CREATED, IndexVersion.current())
200201
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 1)
201202
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
202-
.put(IndexSettings.INDEX_MAPPING_META_LENGTH_LIMIT_SETTING.getKey(), 300)
203+
.put(INDEX_MAPPING_META_LENGTH_LIMIT_SETTING.getKey(), 300)
203204
.build();
204205
MappingParserContext otherParserContext = createParserContext(otherSettings);
205206
String longString = IntStream.range(0, 301).mapToObj(Integer::toString).collect(Collectors.joining());

0 commit comments

Comments
 (0)