org.elasticsearch.action.delete
Class DeleteRequestBuilder

java.lang.Object
  extended by org.elasticsearch.action.support.BaseRequestBuilder<DeleteRequest,DeleteResponse>
      extended by org.elasticsearch.action.delete.DeleteRequestBuilder
All Implemented Interfaces:
ActionRequestBuilder<DeleteRequest,DeleteResponse>

public class DeleteRequestBuilder
extends BaseRequestBuilder<DeleteRequest,DeleteResponse>

A delete document action request builder.


Field Summary
 
Fields inherited from class org.elasticsearch.action.support.BaseRequestBuilder
client, request
 
Constructor Summary
DeleteRequestBuilder(Client client)
           
DeleteRequestBuilder(Client client, String index)
           
 
Method Summary
protected  void doExecute(ActionListener<DeleteResponse> listener)
           
 DeleteRequestBuilder setConsistencyLevel(WriteConsistencyLevel consistencyLevel)
          Sets the consistency level.
 DeleteRequestBuilder setId(String id)
          Sets the id of the document to delete.
 DeleteRequestBuilder setIndex(String index)
          Sets the index the delete will happen on.
 DeleteRequestBuilder setListenerThreaded(boolean threadedListener)
          Should the listener be called on a separate thread if needed.
 DeleteRequestBuilder setOperationThreaded(boolean threadedOperation)
          Controls if the operation will be executed on a separate thread when executed locally.
 DeleteRequestBuilder setParent(String parent)
          Sets the parent id of this document.
 DeleteRequestBuilder setRefresh(boolean refresh)
          Should a refresh be executed post this index operation causing the operation to be searchable.
 DeleteRequestBuilder setReplicationType(ReplicationType replicationType)
          Set the replication type for this operation.
 DeleteRequestBuilder setRouting(String routing)
          Controls the shard routing of the delete request.
 DeleteRequestBuilder setType(String type)
          Sets the type of the document to delete.
 DeleteRequestBuilder setVersion(long version)
          Sets the version, which will cause the delete operation to only be performed if a matching version exists and no changes happened on the doc since then.
 DeleteRequestBuilder setVersionType(VersionType versionType)
          Sets the type of versioning to use.
 
Methods inherited from class org.elasticsearch.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

DeleteRequestBuilder

public DeleteRequestBuilder(Client client)

DeleteRequestBuilder

public DeleteRequestBuilder(Client client,
                            @Nullable
                            String index)
Method Detail

setIndex

public DeleteRequestBuilder setIndex(String index)
Sets the index the delete will happen on.


setType

public DeleteRequestBuilder setType(String type)
Sets the type of the document to delete.


setId

public DeleteRequestBuilder setId(String id)
Sets the id of the document to delete.


setParent

public DeleteRequestBuilder setParent(String parent)
Sets the parent id of this document. Will simply set the routing to this value, as it is only used for routing with delete requests.


setRouting

public DeleteRequestBuilder setRouting(String routing)
Controls the shard routing of the delete request. Using this value to hash the shard and not the id.


setRefresh

public DeleteRequestBuilder setRefresh(boolean refresh)
Should a refresh be executed post this index operation causing the operation to be searchable. Note, heavy indexing should not set this to true. Defaults to false.


setVersion

public DeleteRequestBuilder setVersion(long version)
Sets the version, which will cause the delete operation to only be performed if a matching version exists and no changes happened on the doc since then.


setVersionType

public DeleteRequestBuilder setVersionType(VersionType versionType)
Sets the type of versioning to use. Defaults to VersionType.INTERNAL.


setListenerThreaded

public DeleteRequestBuilder setListenerThreaded(boolean threadedListener)
Should the listener be called on a separate thread if needed.


setOperationThreaded

public DeleteRequestBuilder setOperationThreaded(boolean threadedOperation)
Controls if the operation will be executed on a separate thread when executed locally. Defaults to true when running in embedded mode.


setReplicationType

public DeleteRequestBuilder setReplicationType(ReplicationType replicationType)
Set the replication type for this operation.


setConsistencyLevel

public DeleteRequestBuilder setConsistencyLevel(WriteConsistencyLevel consistencyLevel)
Sets the consistency level. Defaults to WriteConsistencyLevel.DEFAULT.


doExecute

protected void doExecute(ActionListener<DeleteResponse> listener)
Specified by:
doExecute in class BaseRequestBuilder<DeleteRequest,DeleteResponse>


Copyright © 2009-2012. All Rights Reserved.