public class CreateIndexRequestBuilder extends AcknowledgedRequestBuilder<CreateIndexRequest,CreateIndexResponse,CreateIndexRequestBuilder>
action, client, request
Constructor | Description |
---|---|
CreateIndexRequestBuilder(ElasticsearchClient client,
CreateIndexAction action) |
|
CreateIndexRequestBuilder(ElasticsearchClient client,
CreateIndexAction action,
java.lang.String index) |
Modifier and Type | Method | Description |
---|---|---|
CreateIndexRequestBuilder |
addAlias(Alias alias) |
Adds an alias that will be associated with the index when it gets created
|
CreateIndexRequestBuilder |
addCustom(IndexMetaData.Custom custom) |
Adds custom metadata to the index to be created.
|
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").
|
CreateIndexRequestBuilder |
addMapping(java.lang.String type,
java.lang.String source,
XContentType xContentType) |
Adds mapping that will be added when the index gets created.
|
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.
|
CreateIndexRequestBuilder |
addMapping(java.lang.String type,
XContentBuilder source) |
Adds mapping that will be added when the index gets created.
|
CreateIndexRequestBuilder |
setAliases(java.lang.String source) |
Sets the aliases that will be associated with the index when it gets created
|
CreateIndexRequestBuilder |
setAliases(java.util.Map source) |
Sets the aliases that will be associated with the index when it gets created
|
CreateIndexRequestBuilder |
setAliases(BytesReference source) |
Sets the aliases that will be associated with the index when it gets created
|
CreateIndexRequestBuilder |
setAliases(XContentBuilder source) |
Sets the aliases that will be associated with the index when it gets created
|
CreateIndexRequestBuilder |
setCause(java.lang.String cause) |
The cause for this index creation.
|
CreateIndexRequestBuilder |
setIndex(java.lang.String index) |
Sets the name of the index to be created
|
CreateIndexRequestBuilder |
setSettings(java.lang.String source,
XContentType xContentType) |
The settings to create the index with (either json or yaml format)
|
CreateIndexRequestBuilder |
setSettings(java.util.Map<java.lang.String,?> source) |
The settings to create the index with (either json/yaml/properties format)
|
CreateIndexRequestBuilder |
setSettings(Settings settings) |
The settings to create the index with.
|
CreateIndexRequestBuilder |
setSettings(Settings.Builder settings) |
The settings to create the index with.
|
CreateIndexRequestBuilder |
setSettings(XContentBuilder builder) |
Allows to set the settings using a json builder.
|
CreateIndexRequestBuilder |
setSource(byte[] source,
int offset,
int length,
XContentType xContentType) |
Sets the settings and mappings as a single source.
|
CreateIndexRequestBuilder |
setSource(byte[] source,
XContentType xContentType) |
Sets the settings and mappings as a single source.
|
CreateIndexRequestBuilder |
setSource(java.lang.String source,
XContentType xContentType) |
Sets the settings and mappings as a single source.
|
CreateIndexRequestBuilder |
setSource(java.util.Map<java.lang.String,?> source) |
Sets the settings and mappings as a single source.
|
CreateIndexRequestBuilder |
setSource(BytesReference source,
XContentType xContentType) |
Sets the settings and mappings as a single source.
|
CreateIndexRequestBuilder |
setSource(XContentBuilder source) |
Sets the settings and mappings as a single source.
|
CreateIndexRequestBuilder |
setUpdateAllTypes(boolean updateAllTypes) |
Deprecated.
useless with 6.x indices which may only have one type
|
CreateIndexRequestBuilder |
setWaitForActiveShards(int waitForActiveShards) |
A shortcut for
setWaitForActiveShards(ActiveShardCount) where the numerical
shard count is passed in, instead of having to first call ActiveShardCount.from(int)
to get the ActiveShardCount. |
CreateIndexRequestBuilder |
setWaitForActiveShards(ActiveShardCount waitForActiveShards) |
Sets the number of shard copies that should be active for index creation to return.
|
setTimeout, setTimeout
execute, execute, get, get, get, request
setMasterNodeTimeout, setMasterNodeTimeout
public CreateIndexRequestBuilder(ElasticsearchClient client, CreateIndexAction action)
public CreateIndexRequestBuilder(ElasticsearchClient client, CreateIndexAction action, java.lang.String index)
public CreateIndexRequestBuilder setIndex(java.lang.String index)
public CreateIndexRequestBuilder setSettings(Settings settings)
public CreateIndexRequestBuilder setSettings(Settings.Builder settings)
public CreateIndexRequestBuilder setSettings(XContentBuilder builder)
public CreateIndexRequestBuilder setSettings(java.lang.String source, XContentType xContentType)
public CreateIndexRequestBuilder setSettings(java.util.Map<java.lang.String,?> source)
public CreateIndexRequestBuilder addMapping(java.lang.String type, java.lang.String source, XContentType xContentType)
type
- The mapping typesource
- The mapping sourcexContentType
- The content type of the sourcepublic CreateIndexRequestBuilder setCause(java.lang.String cause)
public CreateIndexRequestBuilder addMapping(java.lang.String type, XContentBuilder source)
type
- The mapping typesource
- The mapping sourcepublic CreateIndexRequestBuilder addMapping(java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> source)
type
- The mapping typesource
- The mapping sourcepublic CreateIndexRequestBuilder addMapping(java.lang.String type, java.lang.Object... source)
public CreateIndexRequestBuilder setAliases(java.util.Map source)
public CreateIndexRequestBuilder setAliases(java.lang.String source)
public CreateIndexRequestBuilder setAliases(XContentBuilder source)
public CreateIndexRequestBuilder setAliases(BytesReference source)
public CreateIndexRequestBuilder addAlias(Alias alias)
public CreateIndexRequestBuilder setSource(java.lang.String source, XContentType xContentType)
public CreateIndexRequestBuilder setSource(BytesReference source, XContentType xContentType)
public CreateIndexRequestBuilder setSource(byte[] source, XContentType xContentType)
public CreateIndexRequestBuilder setSource(byte[] source, int offset, int length, XContentType xContentType)
public CreateIndexRequestBuilder setSource(java.util.Map<java.lang.String,?> source)
public CreateIndexRequestBuilder addCustom(IndexMetaData.Custom custom)
public CreateIndexRequestBuilder setSource(XContentBuilder source)
@Deprecated public CreateIndexRequestBuilder setUpdateAllTypes(boolean updateAllTypes)
public CreateIndexRequestBuilder setWaitForActiveShards(ActiveShardCount waitForActiveShards)
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.waitForActiveShards
- number of active shard copies to wait onpublic CreateIndexRequestBuilder setWaitForActiveShards(int waitForActiveShards)
setWaitForActiveShards(ActiveShardCount)
where the numerical
shard count is passed in, instead of having to first call ActiveShardCount.from(int)
to get the ActiveShardCount.