org.elasticsearch.client.action.count
Class CountRequestBuilder

java.lang.Object
  extended by org.elasticsearch.client.action.support.BaseRequestBuilder<CountRequest,CountResponse>
      extended by org.elasticsearch.client.action.count.CountRequestBuilder
All Implemented Interfaces:
RequestBuilder<CountRequest,CountResponse>

public class CountRequestBuilder
extends BaseRequestBuilder<CountRequest,CountResponse>

A count action request builder.


Field Summary
 
Fields inherited from class org.elasticsearch.client.action.support.BaseRequestBuilder
client, request
 
Constructor Summary
CountRequestBuilder(Client client)
           
 
Method Summary
protected  void doExecute(ActionListener<CountResponse> listener)
           
 CountRequestBuilder setIndices(java.lang.String... indices)
          Sets the indices the count query will run against.
 CountRequestBuilder setListenerThreaded(boolean threadedListener)
          Should the listener be called on a separate thread if needed.
 CountRequestBuilder setMinScore(float minScore)
          The minimum score of the documents to include in the count.
 CountRequestBuilder setOperationThreading(BroadcastOperationThreading operationThreading)
          Controls the operation threading model.
 CountRequestBuilder setQuery(byte[] querySource)
          The query source to execute.
 CountRequestBuilder setQuery(QueryBuilder queryBuilder)
          The query source to execute.
 CountRequestBuilder setQueryHint(java.lang.String queryHint)
          A query hint to optionally later be used when routing the request.
 CountRequestBuilder setQueryParserName(java.lang.String queryParserName)
          The query parse name to use.
 CountRequestBuilder setRouting(java.lang.String... routing)
          The routing values to control the shards that the search will be executed on.
 CountRequestBuilder setRouting(java.lang.String routing)
          A comma separated list of routing values to control the shards the search will be executed on.
 CountRequestBuilder setTypes(java.lang.String... types)
          The types of documents the query will run against.
 
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

CountRequestBuilder

public CountRequestBuilder(Client client)
Method Detail

setIndices

public CountRequestBuilder setIndices(java.lang.String... indices)
Sets the indices the count query will run against.


setTypes

public CountRequestBuilder setTypes(java.lang.String... types)
The types of documents the query will run against. Defaults to all types.


setQueryParserName

public CountRequestBuilder setQueryParserName(java.lang.String queryParserName)
The query parse name to use. If not set, will use the default one.


setMinScore

public CountRequestBuilder setMinScore(float minScore)
The minimum score of the documents to include in the count. Defaults to -1 which means all documents will be included in the count.


setQueryHint

public CountRequestBuilder setQueryHint(java.lang.String queryHint)
A query hint to optionally later be used when routing the request.


setRouting

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


setRouting

public CountRequestBuilder setRouting(java.lang.String... routing)
The routing values to control the shards that the search will be executed on.


setQuery

public CountRequestBuilder setQuery(QueryBuilder queryBuilder)
The query source to execute.

See Also:
QueryBuilders

setQuery

public CountRequestBuilder setQuery(byte[] querySource)
The query source to execute.

See Also:
QueryBuilders

setOperationThreading

public CountRequestBuilder setOperationThreading(BroadcastOperationThreading operationThreading)
Controls the operation threading model.


setListenerThreaded

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


doExecute

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