Class RandomCreateIndexGenerator
java.lang.Object
org.opensearch.index.RandomCreateIndexGenerator
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.opensearch.action.admin.indices.alias.Aliasstatic voidrandomAliases(org.opensearch.action.admin.indices.create.CreateIndexRequest request) Sets random aliases to the providedCreateIndexRequeststatic org.opensearch.action.admin.indices.create.CreateIndexRequestReturns a randomCreateIndexRequest.static org.opensearch.common.settings.SettingsReturns aSettingsinstance which include random values forIndexMetadata.SETTING_NUMBER_OF_SHARDSandIndexMetadata.SETTING_NUMBER_OF_REPLICASstatic org.opensearch.core.xcontent.XContentBuilderCreates a random mappingstatic voidrandomMappingFields(org.opensearch.core.xcontent.XContentBuilder builder, boolean allowObjectField) Adds random mapping fields to the providedXContentBuilder
-
Method Details
-
randomCreateIndexRequest
public static org.opensearch.action.admin.indices.create.CreateIndexRequest randomCreateIndexRequest() throws IOExceptionReturns a randomCreateIndexRequest.Randomizes the index name, the aliases, mappings and settings associated with the index. If present, the mapping definition will be nested under a type name.
- Throws:
IOException
-
randomIndexSettings
public static org.opensearch.common.settings.Settings randomIndexSettings()Returns aSettingsinstance which include random values forIndexMetadata.SETTING_NUMBER_OF_SHARDSandIndexMetadata.SETTING_NUMBER_OF_REPLICAS -
randomMapping
Creates a random mapping- Throws:
IOException
-
randomMappingFields
public static void randomMappingFields(org.opensearch.core.xcontent.XContentBuilder builder, boolean allowObjectField) throws IOException Adds random mapping fields to the providedXContentBuilder- Throws:
IOException
-
randomAliases
public static void randomAliases(org.opensearch.action.admin.indices.create.CreateIndexRequest request) Sets random aliases to the providedCreateIndexRequest -
randomAlias
public static org.opensearch.action.admin.indices.alias.Alias randomAlias()
-