org.elasticsearch.action.deletebyquery
Class DeleteByQueryRequest

java.lang.Object
  extended by org.elasticsearch.action.support.replication.IndicesReplicationOperationRequest
      extended by org.elasticsearch.action.deletebyquery.DeleteByQueryRequest
All Implemented Interfaces:
ActionRequest, Streamable

public class DeleteByQueryRequest
extends IndicesReplicationOperationRequest

A request to delete all documents that matching a specific query. Best created with Requests.deleteByQueryRequest(String...).

The request requires the query source to be set either using query(org.elasticsearch.index.query.QueryBuilder), or query(byte[]).

See Also:
DeleteByQueryResponse, Requests.deleteByQueryRequest(String...), Client.deleteByQuery(DeleteByQueryRequest)

Field Summary
 
Fields inherited from class org.elasticsearch.action.support.replication.IndicesReplicationOperationRequest
consistencyLevel, indices, replicationType, timeout
 
Constructor Summary
DeleteByQueryRequest()
           
DeleteByQueryRequest(String... indices)
          Constructs a new delete by query request to run against the provided indices.
 
Method Summary
 DeleteByQueryRequest consistencyLevel(WriteConsistencyLevel consistencyLevel)
           
 DeleteByQueryRequest indices(String... indices)
          The indices the delete by query will run against.
 DeleteByQueryRequest listenerThreaded(boolean threadedListener)
          Should the listener be called on a separate thread if needed.
 DeleteByQueryRequest query(byte[] querySource)
          The query source to execute.
 DeleteByQueryRequest query(byte[] querySource, int offset, int length, boolean unsafe)
          The query source to execute.
 DeleteByQueryRequest query(BytesReference source, boolean unsafe)
           
 DeleteByQueryRequest query(Map querySource)
          The query source to execute in the form of a map.
 DeleteByQueryRequest query(QueryBuilder queryBuilder)
          The query source to execute.
 DeleteByQueryRequest query(String querySource)
          The query source to execute.
 DeleteByQueryRequest query(XContentBuilder builder)
           
 void readFrom(StreamInput in)
           
 DeleteByQueryRequest replicationType(ReplicationType replicationType)
          The replication type to use with this operation.
 DeleteByQueryRequest replicationType(String replicationType)
          The replication type to use with this operation.
 String routing()
          A comma separated list of routing values to control the shards the search will be executed on.
 DeleteByQueryRequest routing(String... routings)
          The routing values to control the shards that the search will be executed on.
 DeleteByQueryRequest routing(String routing)
          A comma separated list of routing values to control the shards the search will be executed on.
 DeleteByQueryRequest timeout(String timeout)
          A timeout to wait if the delete by query operation can't be performed immediately.
 DeleteByQueryRequest timeout(TimeValue timeout)
          A timeout to wait if the delete by query operation can't be performed immediately.
 String toString()
           
 DeleteByQueryRequest types(String... types)
          The types of documents the query will run against.
 ActionRequestValidationException validate()
           
 void writeTo(StreamOutput out)
           
 
Methods inherited from class org.elasticsearch.action.support.replication.IndicesReplicationOperationRequest
consistencyLevel, indices, listenerThreaded, replicationType, timeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeleteByQueryRequest

public DeleteByQueryRequest(String... indices)
Constructs a new delete by query request to run against the provided indices. No indices means it will run against all indices.


DeleteByQueryRequest

public DeleteByQueryRequest()
Method Detail

listenerThreaded

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

Specified by:
listenerThreaded in interface ActionRequest
Overrides:
listenerThreaded in class IndicesReplicationOperationRequest

validate

public ActionRequestValidationException validate()
Specified by:
validate in interface ActionRequest
Overrides:
validate in class IndicesReplicationOperationRequest

indices

public DeleteByQueryRequest indices(String... indices)
The indices the delete by query will run against.

Overrides:
indices in class IndicesReplicationOperationRequest

query

@Required
public DeleteByQueryRequest query(QueryBuilder queryBuilder)
The query source to execute.

See Also:
QueryBuilders

query

@Required
public DeleteByQueryRequest query(String querySource)
The query source to execute. It is preferable to use either query(byte[]) or query(org.elasticsearch.index.query.QueryBuilder).


query

@Required
public DeleteByQueryRequest query(Map querySource)
The query source to execute in the form of a map.


query

@Required
public DeleteByQueryRequest query(XContentBuilder builder)

query

@Required
public DeleteByQueryRequest query(byte[] querySource)
The query source to execute.


query

@Required
public DeleteByQueryRequest query(byte[] querySource,
                                           int offset,
                                           int length,
                                           boolean unsafe)
The query source to execute.


query

public DeleteByQueryRequest query(BytesReference source,
                                  boolean unsafe)

routing

public String routing()
A comma separated list of routing values to control the shards the search will be executed on.

Overrides:
routing in class IndicesReplicationOperationRequest

routing

public DeleteByQueryRequest routing(String routing)
A comma separated list of routing values to control the shards the search will be executed on.


routing

public DeleteByQueryRequest routing(String... routings)
The routing values to control the shards that the search will be executed on.


types

public DeleteByQueryRequest types(String... types)
The types of documents the query will run against. Defaults to all types.


timeout

public DeleteByQueryRequest timeout(TimeValue timeout)
A timeout to wait if the delete by query operation can't be performed immediately. Defaults to 1m.


timeout

public DeleteByQueryRequest timeout(String timeout)
A timeout to wait if the delete by query operation can't be performed immediately. Defaults to 1m.


replicationType

public DeleteByQueryRequest replicationType(ReplicationType replicationType)
The replication type to use with this operation.


consistencyLevel

public DeleteByQueryRequest consistencyLevel(WriteConsistencyLevel consistencyLevel)

replicationType

public DeleteByQueryRequest replicationType(String replicationType)
The replication type to use with this operation.


readFrom

public void readFrom(StreamInput in)
              throws IOException
Specified by:
readFrom in interface Streamable
Overrides:
readFrom in class IndicesReplicationOperationRequest
Throws:
IOException

writeTo

public void writeTo(StreamOutput out)
             throws IOException
Specified by:
writeTo in interface Streamable
Overrides:
writeTo in class IndicesReplicationOperationRequest
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012. All Rights Reserved.