Package org.elasticsearch.action.support
Class AutoCreateIndex
- java.lang.Object
-
- org.elasticsearch.action.support.AutoCreateIndex
-
public final class AutoCreateIndex extends java.lang.ObjectEncapsulates the logic of whether a new index should be automatically created when a write operation is about to happen in a non existing index.
-
-
Field Summary
Fields Modifier and Type Field Description static Setting<org.elasticsearch.action.support.AutoCreateIndex.AutoCreate>AUTO_CREATE_INDEX_SETTING
-
Constructor Summary
Constructors Constructor Description AutoCreateIndex(Settings settings, ClusterSettings clusterSettings, IndexNameExpressionResolver resolver)
-
Method Summary
Modifier and Type Method Description booleanneedToCheck()Do we really need to check if an index should be auto created?booleanshouldAutoCreate(java.lang.String index, ClusterState state)Should the index be auto created?
-
-
-
Field Detail
-
AUTO_CREATE_INDEX_SETTING
public static final Setting<org.elasticsearch.action.support.AutoCreateIndex.AutoCreate> AUTO_CREATE_INDEX_SETTING
-
-
Constructor Detail
-
AutoCreateIndex
public AutoCreateIndex(Settings settings, ClusterSettings clusterSettings, IndexNameExpressionResolver resolver)
-
-
Method Detail
-
needToCheck
public boolean needToCheck()
Do we really need to check if an index should be auto created?
-
shouldAutoCreate
public boolean shouldAutoCreate(java.lang.String index, ClusterState state)Should the index be auto created?- Throws:
IndexNotFoundException- if the index doesn't exist and shouldn't be auto created
-
-