|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.client.action.support.BaseRequestBuilder<IndexRequest,IndexResponse> org.elasticsearch.client.action.index.IndexRequestBuilder
public class IndexRequestBuilder
An index document action request builder.
Field Summary |
---|
Fields inherited from class org.elasticsearch.client.action.support.BaseRequestBuilder |
---|
client, request |
Constructor Summary | |
---|---|
IndexRequestBuilder(Client client,
java.lang.String index)
|
Method Summary | |
---|---|
protected void |
doExecute(ActionListener<IndexResponse> listener)
|
IndexRequestBuilder |
setConsistencyLevel(WriteConsistencyLevel consistencyLevel)
Sets the consistency level. |
IndexRequestBuilder |
setContentType(XContentType contentType)
The content type that will be used to generate a document from user provided objects (like Map). |
IndexRequestBuilder |
setCreate(boolean create)
Set to true to force this index to use IndexRequest.OpType.CREATE . |
IndexRequestBuilder |
setId(java.lang.String id)
Sets the id to index the document under. |
IndexRequestBuilder |
setIndex(java.lang.String index)
Sets the index to index the document to. |
IndexRequestBuilder |
setListenerThreaded(boolean listenerThreaded)
Should the listener be called on a separate thread if needed. |
IndexRequestBuilder |
setOperationThreaded(boolean operationThreaded)
Controls if the operation will be executed on a separate thread when executed locally. |
IndexRequestBuilder |
setOpType(IndexRequest.OpType opType)
Sets the type of operation to perform. |
IndexRequestBuilder |
setOpType(java.lang.String opType)
Sets a string representation of the setOpType(org.elasticsearch.action.index.IndexRequest.OpType) . |
IndexRequestBuilder |
setParent(java.lang.String parent)
Sets the parent id of this document. |
IndexRequestBuilder |
setPercolate(java.lang.String percolate)
Causes the index request document to be percolated. |
IndexRequestBuilder |
setRefresh(boolean refresh)
Should a refresh be executed post this index operation causing the operation to be searchable. |
IndexRequestBuilder |
setReplicationType(ReplicationType replicationType)
Set the replication type for this operation. |
IndexRequestBuilder |
setReplicationType(java.lang.String replicationType)
Set the replication type for this operation. |
IndexRequestBuilder |
setRouting(java.lang.String routing)
Controls the shard routing of the request. |
IndexRequestBuilder |
setSource(byte[] source)
Sets the document to index in bytes form. |
IndexRequestBuilder |
setSource(byte[] source,
int offset,
int length)
Sets the document to index in bytes form (assumed to be safe to be used from different threads). |
IndexRequestBuilder |
setSource(byte[] source,
int offset,
int length,
boolean unsafe)
Sets the document to index in bytes form. |
IndexRequestBuilder |
setSource(java.util.Map<java.lang.String,java.lang.Object> source)
Index the Map as a JSON. |
IndexRequestBuilder |
setSource(java.util.Map<java.lang.String,java.lang.Object> source,
XContentType contentType)
Index the Map as the provided content type. |
IndexRequestBuilder |
setSource(java.lang.String source)
Sets the document source to index. |
IndexRequestBuilder |
setSource(java.lang.String field1,
java.lang.Object value1)
Constructs a simple document with a field and a value. |
IndexRequestBuilder |
setSource(java.lang.String field1,
java.lang.Object value1,
java.lang.String field2,
java.lang.Object value2)
Constructs a simple document with a field and value pairs. |
IndexRequestBuilder |
setSource(java.lang.String field1,
java.lang.Object value1,
java.lang.String field2,
java.lang.Object value2,
java.lang.String field3,
java.lang.Object value3)
Constructs a simple document with a field and value pairs. |
IndexRequestBuilder |
setSource(java.lang.String field1,
java.lang.Object value1,
java.lang.String field2,
java.lang.Object value2,
java.lang.String field3,
java.lang.Object value3,
java.lang.String field4,
java.lang.Object value4)
Constructs a simple document with a field and value pairs. |
IndexRequestBuilder |
setSource(XContentBuilder sourceBuilder)
Sets the content source to index. |
IndexRequestBuilder |
setTimeout(java.lang.String timeout)
A timeout to wait if the index operation can't be performed immediately. |
IndexRequestBuilder |
setTimeout(TimeValue timeout)
A timeout to wait if the index operation can't be performed immediately. |
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. |
Methods inherited from class org.elasticsearch.client.action.support.BaseRequestBuilder |
---|
execute, execute, request |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndexRequestBuilder(Client client, @Nullable java.lang.String index)
Method Detail |
---|
public IndexRequestBuilder setIndex(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)
public IndexRequestBuilder setSource(java.util.Map<java.lang.String,java.lang.Object> source)
source
- The map to indexpublic IndexRequestBuilder setSource(java.util.Map<java.lang.String,java.lang.Object> source, XContentType contentType)
source
- The map to indexpublic IndexRequestBuilder setSource(java.lang.String source)
Note, its preferable to either set it using setSource(org.elasticsearch.common.xcontent.XContentBuilder)
or using the setSource(byte[])
.
public IndexRequestBuilder setSource(XContentBuilder sourceBuilder)
public IndexRequestBuilder setSource(byte[] source)
public IndexRequestBuilder setSource(byte[] source, int offset, int length)
source
- The source to indexoffset
- The offset in the byte arraylength
- The length of the datapublic IndexRequestBuilder setSource(byte[] source, int offset, int length, boolean unsafe)
source
- The source to indexoffset
- The offset in the byte arraylength
- The length of the dataunsafe
- Is the byte array safe to be used form a different threadpublic IndexRequestBuilder setSource(java.lang.String field1, java.lang.Object value1)
public IndexRequestBuilder setSource(java.lang.String field1, java.lang.Object value1, java.lang.String field2, java.lang.Object value2)
public IndexRequestBuilder setSource(java.lang.String field1, java.lang.Object value1, java.lang.String field2, java.lang.Object value2, java.lang.String field3, java.lang.Object value3)
public IndexRequestBuilder setSource(java.lang.String field1, java.lang.Object value1, java.lang.String field2, java.lang.Object value2, java.lang.String field3, java.lang.Object value3, java.lang.String field4, java.lang.Object value4)
public IndexRequestBuilder setContentType(XContentType contentType)
public IndexRequestBuilder setTimeout(TimeValue timeout)
public IndexRequestBuilder setTimeout(java.lang.String timeout)
public IndexRequestBuilder setOpType(IndexRequest.OpType opType)
public IndexRequestBuilder setOpType(java.lang.String opType)
setOpType(org.elasticsearch.action.index.IndexRequest.OpType)
. Can
be either "index" or "create".
public IndexRequestBuilder setCreate(boolean create)
IndexRequest.OpType.CREATE
.
public IndexRequestBuilder setRefresh(boolean refresh)
public IndexRequestBuilder setReplicationType(ReplicationType replicationType)
public IndexRequestBuilder setConsistencyLevel(WriteConsistencyLevel consistencyLevel)
WriteConsistencyLevel.DEFAULT
.
public IndexRequestBuilder setReplicationType(java.lang.String replicationType)
public IndexRequestBuilder setVersion(long version)
public IndexRequestBuilder setVersionType(VersionType versionType)
VersionType.INTERNAL
.
public IndexRequestBuilder setPercolate(java.lang.String percolate)
public IndexRequestBuilder setListenerThreaded(boolean listenerThreaded)
public IndexRequestBuilder setOperationThreaded(boolean operationThreaded)
protected void doExecute(ActionListener<IndexResponse> listener)
doExecute
in class BaseRequestBuilder<IndexRequest,IndexResponse>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |