Skip to content

Commit

Permalink
Remove handling of index.mapper.dynamic in AutoCreateIndex (#13067)
Browse files Browse the repository at this point in the history
* Remove reference to INDEX_MAPPER_DYNAMIC_SETTING in AutoCreateIndex

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
  • Loading branch information
cwperks authored Apr 5, 2024
1 parent e713175 commit 55f6b5d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Deprecated

### Removed
- Remove handling of index.mapper.dynamic in AutoCreateIndex([#13067](https://github.com/opensearch-project/OpenSearch/pull/13067))

### Fixed
- Fix bulk API ignores ingest pipeline for upsert ([#12883](https://github.com/opensearch-project/OpenSearch/pull/12883))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.core.common.Strings;
import org.opensearch.index.IndexNotFoundException;
import org.opensearch.index.mapper.MapperService;
import org.opensearch.indices.SystemIndices;

import java.util.ArrayList;
Expand All @@ -64,8 +63,6 @@ public final class AutoCreateIndex {
Property.NodeScope,
Setting.Property.Dynamic
);

private final boolean dynamicMappingDisabled;
private final IndexNameExpressionResolver resolver;
private final SystemIndices systemIndices;
private volatile AutoCreate autoCreate;
Expand All @@ -77,7 +74,6 @@ public AutoCreateIndex(
SystemIndices systemIndices
) {
this.resolver = resolver;
dynamicMappingDisabled = !MapperService.INDEX_MAPPER_DYNAMIC_SETTING.get(settings);
this.systemIndices = systemIndices;
this.autoCreate = AUTO_CREATE_INDEX_SETTING.get(settings);
clusterSettings.addSettingsUpdateConsumer(AUTO_CREATE_INDEX_SETTING, this::setAutoCreate);
Expand Down Expand Up @@ -109,9 +105,6 @@ public boolean shouldAutoCreate(String index, ClusterState state) {
if (autoCreate.autoCreateIndex == false) {
throw new IndexNotFoundException("[" + AUTO_CREATE_INDEX_SETTING.getKey() + "] is [false]", index);
}
if (dynamicMappingDisabled) {
throw new IndexNotFoundException("[" + MapperService.INDEX_MAPPER_DYNAMIC_SETTING.getKey() + "] is [false]", index);
}
// matches not set, default value of "true"
if (autoCreate.expressions.isEmpty()) {
return true;
Expand Down

0 comments on commit 55f6b5d

Please sign in to comment.