org.elasticsearch.action.admin.indices.create
Class CreateIndexRequest

java.lang.Object
  extended by org.elasticsearch.action.support.master.MasterNodeOperationRequest
      extended by org.elasticsearch.action.admin.indices.create.CreateIndexRequest
All Implemented Interfaces:
ActionRequest, Streamable

public class CreateIndexRequest
extends MasterNodeOperationRequest

A request to create an index. Best created with Requests.createIndexRequest(String).

The index created can optionally be created with settings(org.elasticsearch.common.settings.Settings).

See Also:
IndicesAdminClient.create(CreateIndexRequest), Requests.createIndexRequest(String), CreateIndexResponse

Constructor Summary
CreateIndexRequest(java.lang.String index)
          Constructs a new request to create an index with the specified name.
CreateIndexRequest(java.lang.String index, Settings settings)
          Constructs a new request to create an index with the specified name and settings.
 
Method Summary
 CreateIndexRequest cause(java.lang.String cause)
          The cause for this index creation.
 CreateIndexRequest mapping(java.lang.String type, java.util.Map source)
          Adds mapping that will be added when the index gets created.
 CreateIndexRequest mapping(java.lang.String type, java.lang.String source)
          Adds mapping that will be added when the index gets created.
 CreateIndexRequest mapping(java.lang.String type, XContentBuilder source)
          Adds mapping that will be added when the index gets created.
 void readFrom(StreamInput in)
           
 CreateIndexRequest settings(java.util.Map source)
          The settings to crete the index with (either json/yaml/properties format)
 CreateIndexRequest settings(Settings.Builder settings)
          The settings to created the index with.
 CreateIndexRequest settings(Settings settings)
          The settings to created the index with.
 CreateIndexRequest settings(java.lang.String source)
          The settings to crete the index with (either json/yaml/properties format)
 CreateIndexRequest settings(XContentBuilder builder)
          Allows to set the settings using a json builder.
 CreateIndexRequest timeout(java.lang.String timeout)
          Timeout to wait for the index creation to be acknowledged by current cluster nodes.
 CreateIndexRequest timeout(TimeValue timeout)
          Timeout to wait for the index creation to be acknowledged by current cluster nodes.
 ActionRequestValidationException validate()
           
 void writeTo(StreamOutput out)
           
 
Methods inherited from class org.elasticsearch.action.support.master.MasterNodeOperationRequest
listenerThreaded, listenerThreaded, masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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

validate

public ActionRequestValidationException validate()

settings

public CreateIndexRequest settings(Settings settings)
The settings to created the index with.


settings

public CreateIndexRequest settings(Settings.Builder settings)
The settings to created the index with.


settings

public CreateIndexRequest settings(java.lang.String source)
The settings to crete the index with (either json/yaml/properties format)


settings

public CreateIndexRequest settings(XContentBuilder builder)
Allows to set the settings using a json builder.


settings

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


mapping

public CreateIndexRequest mapping(java.lang.String type,
                                  java.lang.String source)
Adds mapping that will be added when the index gets created.

Parameters:
type - The mapping type
source - The mapping 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

timeout

public CreateIndexRequest timeout(TimeValue timeout)
Timeout to wait for the index creation to be acknowledged by current cluster nodes. Defaults to 10s.


timeout

public CreateIndexRequest timeout(java.lang.String timeout)
Timeout to wait for the index creation to be acknowledged by current cluster nodes. Defaults to 10s.


readFrom

public void readFrom(StreamInput in)
              throws java.io.IOException
Specified by:
readFrom in interface Streamable
Overrides:
readFrom in class MasterNodeOperationRequest
Throws:
java.io.IOException

writeTo

public void writeTo(StreamOutput out)
             throws java.io.IOException
Specified by:
writeTo in interface Streamable
Overrides:
writeTo in class MasterNodeOperationRequest
Throws:
java.io.IOException