Class RandomCreateIndexGenerator

java.lang.Object
org.elasticsearch.index.RandomCreateIndexGenerator

public final class RandomCreateIndexGenerator
extends java.lang.Object
  • Method Summary

    Modifier and Type Method Description
    static org.elasticsearch.action.admin.indices.alias.Alias randomAlias()  
    static void randomAliases​(org.elasticsearch.action.admin.indices.create.CreateIndexRequest request)
    Sets random aliases to the provided CreateIndexRequest
    static org.elasticsearch.action.admin.indices.create.CreateIndexRequest randomCreateIndexRequest()
    Returns a random CreateIndexRequest.
    static org.elasticsearch.common.settings.Settings randomIndexSettings()
    Returns a Settings instance which include random values for IndexMetadata.SETTING_NUMBER_OF_SHARDS and IndexMetadata.SETTING_NUMBER_OF_REPLICAS
    static org.elasticsearch.common.xcontent.XContentBuilder randomMapping​(java.lang.String type)
    Creates a random mapping, with the mapping definition nested under the given type name.
    static void randomMappingFields​(org.elasticsearch.common.xcontent.XContentBuilder builder, boolean allowObjectField)
    Adds random mapping fields to the provided XContentBuilder

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • randomCreateIndexRequest

      public static org.elasticsearch.action.admin.indices.create.CreateIndexRequest randomCreateIndexRequest() throws java.io.IOException
      Returns a random CreateIndexRequest. 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:
      java.io.IOException
    • randomIndexSettings

      public static org.elasticsearch.common.settings.Settings randomIndexSettings()
      Returns a Settings instance which include random values for IndexMetadata.SETTING_NUMBER_OF_SHARDS and IndexMetadata.SETTING_NUMBER_OF_REPLICAS
    • randomMapping

      public static org.elasticsearch.common.xcontent.XContentBuilder randomMapping​(java.lang.String type) throws java.io.IOException
      Creates a random mapping, with the mapping definition nested under the given type name.
      Throws:
      java.io.IOException
    • randomMappingFields

      public static void randomMappingFields​(org.elasticsearch.common.xcontent.XContentBuilder builder, boolean allowObjectField) throws java.io.IOException
      Adds random mapping fields to the provided XContentBuilder
      Throws:
      java.io.IOException
    • randomAliases

      public static void randomAliases​(org.elasticsearch.action.admin.indices.create.CreateIndexRequest request)
      Sets random aliases to the provided CreateIndexRequest
    • randomAlias

      public static org.elasticsearch.action.admin.indices.alias.Alias randomAlias()