Class CreateIndexRequest

    • Constructor Detail

      • CreateIndexRequest

        public CreateIndexRequest()
      • CreateIndexRequest

        public CreateIndexRequest​(java.lang.String index)
        Constructs a new request to create an index with the specified name.
      • CreateIndexRequest

        public CreateIndexRequest​(java.lang.String index,
                                  Settings settings)
        Constructs a new request to create an index with the specified name and settings.
    • Method Detail

      • indices

        public java.lang.String[] indices()
        Description copied from interface: IndicesRequest
        Returns the array of indices that the action relates to
        Specified by:
        indices in interface IndicesRequest
      • indicesOptions

        public IndicesOptions indicesOptions()
        Description copied from interface: IndicesRequest
        Returns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.
        Specified by:
        indicesOptions in interface IndicesRequest
      • index

        public java.lang.String index()
        The index name to create.
      • settings

        public Settings settings()
        The settings to create the index with.
      • cause

        public java.lang.String cause()
        The cause for this index creation.
      • settings

        public CreateIndexRequest settings​(java.lang.String source,
                                           XContentType xContentType)
        The settings to create the index with (either json or yaml format)
      • settings

        public CreateIndexRequest settings​(java.util.Map source)
        The settings to create the index with (either json/yaml/properties format)
      • mapping

        public CreateIndexRequest mapping​(java.lang.String type,
                                          java.lang.String source,
                                          XContentType xContentType)
        Adds mapping that will be added when the index gets created.
        Parameters:
        type - The mapping type
        source - The mapping source
        xContentType - The content type of the source
      • cause

        public CreateIndexRequest cause​(java.lang.String cause)
        The cause for this index creation.
      • mapping

        public CreateIndexRequest mapping​(java.lang.String type,
                                          XContentBuilder source)
        Adds mapping that will be added when the index gets created.
        Parameters:
        type - The mapping type
        source - The mapping source
      • mapping

        public CreateIndexRequest mapping​(java.lang.String type,
                                          java.util.Map source)
        Adds mapping that will be added when the index gets created.
        Parameters:
        type - The mapping type
        source - The mapping source
      • mapping

        public CreateIndexRequest mapping​(java.lang.String type,
                                          java.lang.Object... source)
        A specialized simplified mapping source method, takes the form of simple properties definition: ("field1", "type=string,store=true").
      • aliases

        public CreateIndexRequest aliases​(java.util.Map source)
        Sets the aliases that will be associated with the index when it gets created
      • aliases

        public CreateIndexRequest aliases​(java.lang.String source)
        Sets the aliases that will be associated with the index when it gets created
      • alias

        public CreateIndexRequest alias​(Alias alias)
        Adds an alias that will be associated with the index when it gets created
      • source

        public CreateIndexRequest source​(java.lang.String source,
                                         XContentType xContentType)
        Sets the settings and mappings as a single source.
      • source

        public CreateIndexRequest source​(byte[] source,
                                         int offset,
                                         int length,
                                         XContentType xContentType)
        Sets the settings and mappings as a single source.
      • source

        public CreateIndexRequest source​(java.util.Map<java.lang.String,​?> source,
                                         DeprecationHandler deprecationHandler)
        Sets the settings and mappings as a single source.
      • mappings

        public java.util.Map<java.lang.String,​java.lang.String> mappings()
      • aliases

        public java.util.Set<Alias> aliases()
      • updateAllTypes

        public boolean updateAllTypes()
        True if all fields that span multiple types should be updated, false otherwise
      • updateAllTypes

        @Deprecated
        public CreateIndexRequest updateAllTypes​(boolean updateAllTypes)
        Deprecated.
        useless with 6.x indices which may only have one type
      • waitForActiveShards

        public CreateIndexRequest waitForActiveShards​(ActiveShardCount waitForActiveShards)
        Sets the number of shard copies that should be active for index creation to return. Defaults to ActiveShardCount.DEFAULT, which will wait for one shard copy (the primary) to become active. Set this value to ActiveShardCount.ALL to wait for all shards (primary and all replicas) to be active before returning. Otherwise, use ActiveShardCount.from(int) to set this value to any non-negative integer, up to the number of copies per shard (number of replicas + 1), to wait for the desired amount of shard copies to become active before returning. Index creation will only wait up until the timeout value for the number of shard copies to be active before returning. Check ShardsAcknowledgedResponse.isShardsAcknowledged() to determine if the requisite shard copies were all started before returning or timing out.
        Parameters:
        waitForActiveShards - number of active shard copies to wait on