public class IndexRequestBuilder extends ReplicationRequestBuilder<IndexRequest,IndexResponse,IndexRequestBuilder> implements WriteRequestBuilder<IndexRequestBuilder>
action, client, request
Constructor and Description |
---|
IndexRequestBuilder(ElasticsearchClient client,
IndexAction action) |
IndexRequestBuilder(ElasticsearchClient client,
IndexAction action,
java.lang.String index) |
Modifier and Type | Method and Description |
---|---|
IndexRequestBuilder |
setCreate(boolean create)
Set to true to force this index to use
org.elasticsearch.action.index.IndexRequest.OpType#CREATE . |
IndexRequestBuilder |
setId(java.lang.String id)
Sets the id to index the document under.
|
IndexRequestBuilder |
setOpType(DocWriteRequest.OpType opType)
Sets the type of operation to perform.
|
IndexRequestBuilder |
setParent(java.lang.String parent)
Sets the parent id of this document.
|
IndexRequestBuilder |
setPipeline(java.lang.String pipeline)
Sets the ingest pipeline to be executed before indexing the document
|
IndexRequestBuilder |
setRouting(java.lang.String routing)
Controls the shard routing of the request.
|
IndexRequestBuilder |
setSource(byte[] source)
Deprecated.
|
IndexRequestBuilder |
setSource(byte[] source,
int offset,
int length)
Deprecated.
|
IndexRequestBuilder |
setSource(byte[] source,
int offset,
int length,
XContentType xContentType)
Sets the document to index in bytes form (assumed to be safe to be used from different
threads).
|
IndexRequestBuilder |
setSource(byte[] source,
XContentType xContentType)
Sets the document to index in bytes form.
|
IndexRequestBuilder |
setSource(BytesReference source)
Deprecated.
|
IndexRequestBuilder |
setSource(BytesReference source,
XContentType xContentType)
Sets the source.
|
IndexRequestBuilder |
setSource(java.util.Map<java.lang.String,?> source)
Index the Map as a JSON.
|
IndexRequestBuilder |
setSource(java.util.Map<java.lang.String,?> source,
XContentType contentType)
Index the Map as the provided content type.
|
IndexRequestBuilder |
setSource(java.lang.Object... source)
Constructs a simple document with a field name and value pairs.
|
IndexRequestBuilder |
setSource(java.lang.String source)
Deprecated.
|
IndexRequestBuilder |
setSource(java.lang.String source,
XContentType xContentType)
Sets the document source to index.
|
IndexRequestBuilder |
setSource(XContentBuilder sourceBuilder)
Sets the content source to index.
|
IndexRequestBuilder |
setSource(XContentType xContentType,
java.lang.Object... source)
Constructs a simple document with a field name and value pairs.
|
IndexRequestBuilder |
setTimestamp(java.lang.String timestamp)
Deprecated.
|
IndexRequestBuilder |
setTTL(long ttl)
Deprecated.
|
IndexRequestBuilder |
setTTL(java.lang.String ttl)
Deprecated.
|
IndexRequestBuilder |
setTTL(TimeValue ttl)
Deprecated.
|
IndexRequestBuilder |
setType(java.lang.String type)
Sets the type to index the document to.
|
IndexRequestBuilder |
setVersion(long version)
Sets the version, which will cause the index operation to only be performed if a matching
version exists and no changes happened on the doc since then.
|
IndexRequestBuilder |
setVersionType(VersionType versionType)
Sets the versioning type.
|
setIndex, setTimeout, setTimeout, setWaitForActiveShards, setWaitForActiveShards
beforeExecute, execute, execute, get, get, get, request
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
request, setRefreshPolicy, setRefreshPolicy
public IndexRequestBuilder(ElasticsearchClient client, IndexAction action)
public IndexRequestBuilder(ElasticsearchClient client, IndexAction action, @Nullable java.lang.String index)
public IndexRequestBuilder setType(java.lang.String type)
public IndexRequestBuilder setId(java.lang.String id)
public IndexRequestBuilder setRouting(java.lang.String routing)
public IndexRequestBuilder setParent(java.lang.String parent)
@Deprecated public IndexRequestBuilder setSource(BytesReference source)
setSource(BytesReference, XContentType)
public IndexRequestBuilder setSource(BytesReference source, XContentType xContentType)
public IndexRequestBuilder setSource(java.util.Map<java.lang.String,?> source)
source
- The map to indexpublic IndexRequestBuilder setSource(java.util.Map<java.lang.String,?> source, XContentType contentType)
source
- The map to index@Deprecated public IndexRequestBuilder setSource(java.lang.String source)
setSource(String, XContentType)
Note, its preferable to either set it using setSource(org.elasticsearch.common.xcontent.XContentBuilder)
or using the setSource(byte[], XContentType)
.
public IndexRequestBuilder setSource(java.lang.String source, XContentType xContentType)
Note, its preferable to either set it using setSource(org.elasticsearch.common.xcontent.XContentBuilder)
or using the setSource(byte[], XContentType)
.
public IndexRequestBuilder setSource(XContentBuilder sourceBuilder)
@Deprecated public IndexRequestBuilder setSource(byte[] source)
setSource(byte[], XContentType)
public IndexRequestBuilder setSource(byte[] source, XContentType xContentType)
@Deprecated public IndexRequestBuilder setSource(byte[] source, int offset, int length)
setSource(byte[], int, int, XContentType)
source
- The source to indexoffset
- The offset in the byte arraylength
- The length of the datapublic IndexRequestBuilder setSource(byte[] source, int offset, int length, XContentType xContentType)
source
- The source to indexoffset
- The offset in the byte arraylength
- The length of the dataxContentType
- The type/format of the sourcepublic IndexRequestBuilder setSource(java.lang.Object... source)
Note: the number of objects passed to this method must be an even number. Also the first argument in each pair (the field name) must have a valid String representation.
public IndexRequestBuilder setSource(XContentType xContentType, java.lang.Object... source)
Note: the number of objects passed as varargs to this method must be an even number. Also the first argument in each pair (the field name) must have a valid String representation.
public IndexRequestBuilder setOpType(DocWriteRequest.OpType opType)
public IndexRequestBuilder setCreate(boolean create)
org.elasticsearch.action.index.IndexRequest.OpType#CREATE
.public IndexRequestBuilder setVersion(long version)
public IndexRequestBuilder setVersionType(VersionType versionType)
VersionType.INTERNAL
.@Deprecated public IndexRequestBuilder setTimestamp(java.lang.String timestamp)
@Deprecated public IndexRequestBuilder setTTL(java.lang.String ttl)
@Deprecated public IndexRequestBuilder setTTL(long ttl)
@Deprecated public IndexRequestBuilder setTTL(TimeValue ttl)
TimeValue
instance.public IndexRequestBuilder setPipeline(java.lang.String pipeline)