public class CreateIndexRequest extends AcknowledgedRequest<CreateIndexRequest> implements IndicesRequest
Requests.createIndexRequest(String)
.
The index created can optionally be created with settings(org.elasticsearch.common.settings.Settings)
.
TransportRequest.Empty
IndicesRequest.Replaceable
DEFAULT_ACK_TIMEOUT, timeout
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
headers
Constructor and Description |
---|
CreateIndexRequest() |
CreateIndexRequest(ActionRequest request)
Constructs a new request to create an index that was triggered by a different request,
provided as an argument so that its headers and context can be copied to the new request.
|
CreateIndexRequest(String index)
Constructs a new request to create an index with the specified name.
|
CreateIndexRequest(String index,
Settings settings)
Constructs a new request to create an index with the specified name and settings.
|
Modifier and Type | Method and Description |
---|---|
CreateIndexRequest |
alias(Alias alias)
Adds an alias that will be associated with the index when it gets created
|
Set<Alias> |
aliases() |
CreateIndexRequest |
aliases(BytesReference source)
Sets the aliases that will be associated with the index when it gets created
|
CreateIndexRequest |
aliases(Map source)
Sets the aliases that will be associated with the index when it gets created
|
CreateIndexRequest |
aliases(String source)
Sets the aliases that will be associated with the index when it gets created
|
CreateIndexRequest |
aliases(XContentBuilder source)
Sets the aliases that will be associated with the index when it gets created
|
String |
cause()
The cause for this index creation.
|
CreateIndexRequest |
cause(String cause)
The cause for this index creation.
|
CreateIndexRequest |
custom(IndexMetaData.Custom custom)
Adds custom metadata to the index to be created.
|
Map<String,IndexMetaData.Custom> |
customs() |
String |
index()
The index name to create.
|
CreateIndexRequest |
index(String index) |
String[] |
indices()
Returns the array of indices that the action relates to
|
IndicesOptions |
indicesOptions()
Returns the indices options used to resolve indices.
|
CreateIndexRequest |
mapping(String type,
Map source)
Adds mapping that will be added when the index gets created.
|
CreateIndexRequest |
mapping(String type,
Object... source)
A specialized simplified mapping source method, takes the form of simple properties definition:
("field1", "type=string,store=true").
|
CreateIndexRequest |
mapping(String type,
String source)
Adds mapping that will be added when the index gets created.
|
CreateIndexRequest |
mapping(String type,
XContentBuilder source)
Adds mapping that will be added when the index gets created.
|
Map<String,String> |
mappings() |
void |
readFrom(StreamInput in) |
Settings |
settings()
The settings to create the index with.
|
CreateIndexRequest |
settings(Map source)
The settings to create the index with (either json/yaml/properties format)
|
CreateIndexRequest |
settings(Object... settings)
A simplified version of settings that takes key value pairs settings.
|
CreateIndexRequest |
settings(Settings.Builder settings)
The settings to create the index with.
|
CreateIndexRequest |
settings(Settings settings)
The settings to create the index with.
|
CreateIndexRequest |
settings(String source)
The settings to create the index with (either json/yaml/properties format)
|
CreateIndexRequest |
settings(XContentBuilder builder)
Allows to set the settings using a json builder.
|
CreateIndexRequest |
source(byte[] source)
Sets the settings and mappings as a single source.
|
CreateIndexRequest |
source(byte[] source,
int offset,
int length)
Sets the settings and mappings as a single source.
|
CreateIndexRequest |
source(BytesReference source)
Sets the settings and mappings as a single source.
|
CreateIndexRequest |
source(Map<String,?> source)
Sets the settings and mappings as a single source.
|
CreateIndexRequest |
source(String source)
Sets the settings and mappings as a single source.
|
CreateIndexRequest |
source(XContentBuilder source)
Sets the settings and mappings as a single source.
|
boolean |
updateAllTypes()
True if all fields that span multiple types should be updated, false otherwise
|
CreateIndexRequest |
updateAllTypes(boolean updateAllTypes)
See
updateAllTypes() |
ActionRequestValidationException |
validate() |
void |
writeTo(StreamOutput out) |
ackTimeout, readTimeout, timeout, timeout, timeout, writeTimeout
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
createTask, createTask, setParentTask
getDescription
remoteAddress, remoteAddress
contextSize, copyContextAndHeadersFrom, copyContextFrom, copyHeadersFrom, getContext, getFromContext, getFromContext, getHeader, getHeaders, hasHeader, hasInContext, isContextEmpty, putAllInContext, putHeader, putInContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
masterNodeTimeout
public CreateIndexRequest()
public CreateIndexRequest(ActionRequest request)
public CreateIndexRequest(String index)
public ActionRequestValidationException validate()
validate
in class ActionRequest<CreateIndexRequest>
public String[] indices()
IndicesRequest
indices
in interface IndicesRequest
public IndicesOptions indicesOptions()
IndicesRequest
indicesOptions
in interface IndicesRequest
public String index()
public CreateIndexRequest index(String index)
public Settings settings()
public String cause()
public CreateIndexRequest settings(Object... settings)
public CreateIndexRequest settings(Settings settings)
public CreateIndexRequest settings(Settings.Builder settings)
public CreateIndexRequest settings(String source)
public CreateIndexRequest settings(XContentBuilder builder)
public CreateIndexRequest settings(Map source)
public CreateIndexRequest mapping(String type, String source)
type
- The mapping typesource
- The mapping sourcepublic CreateIndexRequest cause(String cause)
public CreateIndexRequest mapping(String type, XContentBuilder source)
type
- The mapping typesource
- The mapping sourcepublic CreateIndexRequest mapping(String type, Map source)
type
- The mapping typesource
- The mapping sourcepublic CreateIndexRequest mapping(String type, Object... source)
public CreateIndexRequest aliases(Map source)
public CreateIndexRequest aliases(XContentBuilder source)
public CreateIndexRequest aliases(String source)
public CreateIndexRequest aliases(BytesReference source)
public CreateIndexRequest alias(Alias alias)
public CreateIndexRequest source(String source)
public CreateIndexRequest source(XContentBuilder source)
public CreateIndexRequest source(byte[] source)
public CreateIndexRequest source(byte[] source, int offset, int length)
public CreateIndexRequest source(BytesReference source)
public CreateIndexRequest source(Map<String,?> source)
public CreateIndexRequest custom(IndexMetaData.Custom custom)
public Map<String,IndexMetaData.Custom> customs()
public boolean updateAllTypes()
public CreateIndexRequest updateAllTypes(boolean updateAllTypes)
updateAllTypes()
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
readFrom
in class MasterNodeRequest<CreateIndexRequest>
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
writeTo
in class MasterNodeRequest<CreateIndexRequest>
IOException
Copyright © 2009–2016. All rights reserved.