public class PutIndexedScriptRequestBuilder extends ActionRequestBuilder<PutIndexedScriptRequest,PutIndexedScriptResponse,PutIndexedScriptRequestBuilder,Client>
client, request
Constructor and Description |
---|
PutIndexedScriptRequestBuilder(Client client) |
Modifier and Type | Method and Description |
---|---|
protected void |
doExecute(ActionListener<PutIndexedScriptResponse> listener) |
PutIndexedScriptRequestBuilder |
setContentType(XContentType contentType)
The content type that will be used to generate a document from user provided objects (like Map).
|
PutIndexedScriptRequestBuilder |
setCreate(boolean create)
Set to true to force this index to use
IndexRequest.OpType.CREATE . |
PutIndexedScriptRequestBuilder |
setId(String id)
Sets the id to index the document under.
|
PutIndexedScriptRequestBuilder |
setOpType(IndexRequest.OpType opType)
Sets the type of operation to perform.
|
PutIndexedScriptRequestBuilder |
setOpType(String opType)
Sets a string representation of the
setOpType(org.elasticsearch.action.index.IndexRequest.OpType) . |
PutIndexedScriptRequestBuilder |
setScriptLang(String scriptLang)
Sets the type to index the document to.
|
PutIndexedScriptRequestBuilder |
setSource(byte[] source)
Sets the document to index in bytes form.
|
PutIndexedScriptRequestBuilder |
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).
|
PutIndexedScriptRequestBuilder |
setSource(byte[] source,
int offset,
int length,
boolean unsafe)
Sets the document to index in bytes form.
|
PutIndexedScriptRequestBuilder |
setSource(BytesReference source)
Sets the source.
|
PutIndexedScriptRequestBuilder |
setSource(BytesReference source,
boolean unsafe)
Sets the source.
|
PutIndexedScriptRequestBuilder |
setSource(Map<String,Object> source)
Index the Map as a JSON.
|
PutIndexedScriptRequestBuilder |
setSource(Map<String,Object> source,
XContentType contentType)
Index the Map as the provided content type.
|
PutIndexedScriptRequestBuilder |
setSource(Object... source)
Constructs a simple document with a field name and value pairs.
|
PutIndexedScriptRequestBuilder |
setSource(String source)
Sets the document source to index.
|
PutIndexedScriptRequestBuilder |
setSource(XContentBuilder sourceBuilder)
Sets the content source to index.
|
PutIndexedScriptRequestBuilder |
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.
|
PutIndexedScriptRequestBuilder |
setVersionType(VersionType versionType)
Sets the versioning type.
|
execute, execute, get, get, get, putHeader, request, setListenerThreaded
public PutIndexedScriptRequestBuilder(Client client)
public PutIndexedScriptRequestBuilder setScriptLang(String scriptLang)
public PutIndexedScriptRequestBuilder setId(String id)
public PutIndexedScriptRequestBuilder setSource(BytesReference source, boolean unsafe)
public PutIndexedScriptRequestBuilder setSource(BytesReference source)
public PutIndexedScriptRequestBuilder setSource(Map<String,Object> source)
source
- The map to indexpublic PutIndexedScriptRequestBuilder setSource(Map<String,Object> source, XContentType contentType)
source
- The map to indexpublic PutIndexedScriptRequestBuilder setSource(String source)
Note, its preferable to either set it using setSource(org.elasticsearch.common.xcontent.XContentBuilder)
or using the setSource(byte[])
.
public PutIndexedScriptRequestBuilder setSource(XContentBuilder sourceBuilder)
public PutIndexedScriptRequestBuilder setSource(byte[] source)
public PutIndexedScriptRequestBuilder setSource(byte[] source, int offset, int length)
source
- The source to indexoffset
- The offset in the byte arraylength
- The length of the datapublic PutIndexedScriptRequestBuilder 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 PutIndexedScriptRequestBuilder setSource(Object... source)
public PutIndexedScriptRequestBuilder setContentType(XContentType contentType)
public PutIndexedScriptRequestBuilder setOpType(IndexRequest.OpType opType)
public PutIndexedScriptRequestBuilder setOpType(String opType)
setOpType(org.elasticsearch.action.index.IndexRequest.OpType)
. Can
be either "index" or "create".public PutIndexedScriptRequestBuilder setCreate(boolean create)
IndexRequest.OpType.CREATE
.public PutIndexedScriptRequestBuilder setVersion(long version)
public PutIndexedScriptRequestBuilder setVersionType(VersionType versionType)
VersionType.INTERNAL
.protected void doExecute(ActionListener<PutIndexedScriptResponse> listener)
doExecute
in class ActionRequestBuilder<PutIndexedScriptRequest,PutIndexedScriptResponse,PutIndexedScriptRequestBuilder,Client>
Copyright © 2009–2015. All rights reserved.