43
43
import org .opensearch .common .settings .Settings ;
44
44
import org .opensearch .core .common .Strings ;
45
45
import org .opensearch .index .IndexNotFoundException ;
46
- import org .opensearch .index .mapper .MapperService ;
47
46
import org .opensearch .indices .SystemIndices ;
48
47
49
48
import java .util .ArrayList ;
@@ -64,8 +63,6 @@ public final class AutoCreateIndex {
64
63
Property .NodeScope ,
65
64
Setting .Property .Dynamic
66
65
);
67
-
68
- private final boolean dynamicMappingDisabled ;
69
66
private final IndexNameExpressionResolver resolver ;
70
67
private final SystemIndices systemIndices ;
71
68
private volatile AutoCreate autoCreate ;
@@ -77,7 +74,6 @@ public AutoCreateIndex(
77
74
SystemIndices systemIndices
78
75
) {
79
76
this .resolver = resolver ;
80
- dynamicMappingDisabled = !MapperService .INDEX_MAPPER_DYNAMIC_SETTING .get (settings );
81
77
this .systemIndices = systemIndices ;
82
78
this .autoCreate = AUTO_CREATE_INDEX_SETTING .get (settings );
83
79
clusterSettings .addSettingsUpdateConsumer (AUTO_CREATE_INDEX_SETTING , this ::setAutoCreate );
@@ -109,9 +105,6 @@ public boolean shouldAutoCreate(String index, ClusterState state) {
109
105
if (autoCreate .autoCreateIndex == false ) {
110
106
throw new IndexNotFoundException ("[" + AUTO_CREATE_INDEX_SETTING .getKey () + "] is [false]" , index );
111
107
}
112
- if (dynamicMappingDisabled ) {
113
- throw new IndexNotFoundException ("[" + MapperService .INDEX_MAPPER_DYNAMIC_SETTING .getKey () + "] is [false]" , index );
114
- }
115
108
// matches not set, default value of "true"
116
109
if (autoCreate .expressions .isEmpty ()) {
117
110
return true ;
0 commit comments