Class CreateIndexRequestBuilder

    • Method Detail

      • setSettings

        public CreateIndexRequestBuilder setSettings​(java.util.Map<java.lang.String,​?> source)
        The settings to create the index with (either json/yaml/properties format)
      • addMapping

        public CreateIndexRequestBuilder addMapping​(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
      • addMapping

        public CreateIndexRequestBuilder addMapping​(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
      • addMapping

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

        public CreateIndexRequestBuilder addMapping​(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").
      • setAliases

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

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

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

        @Deprecated
        public CreateIndexRequestBuilder setUpdateAllTypes​(boolean updateAllTypes)
        Deprecated.
        useless with 6.x indices which may only have one type
        True if all fields that span multiple types should be updated, false otherwise
      • setWaitForActiveShards

        public CreateIndexRequestBuilder setWaitForActiveShards​(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