public class CountRequest extends BroadcastOperationRequest<CountRequest>
Requests.countRequest(String...)
.
The request requires the query source to be set either using source(QuerySourceBuilder)
,
or source(byte[])
.
TransportRequest.Empty
IndicesRequest.Replaceable
Modifier and Type | Field and Description |
---|---|
static float |
DEFAULT_MIN_SCORE |
protected String |
routing |
indices
Constructor and Description |
---|
CountRequest(String... indices)
Constructs a new count request against the provided indices.
|
Modifier and Type | Method and Description |
---|---|
protected void |
beforeStart() |
float |
minScore()
The minimum score of the documents to include in the count.
|
CountRequest |
minScore(float minScore)
The minimum score of the documents to include in the count.
|
String |
preference() |
CountRequest |
preference(String preference) |
void |
readFrom(StreamInput in) |
String |
routing()
A comma separated list of routing values to control the shards the search will be executed on.
|
CountRequest |
routing(String... routings)
The routing values to control the shards that the search will be executed on.
|
CountRequest |
routing(String routing)
A comma separated list of routing values to control the shards the search will be executed on.
|
BytesReference |
source()
The source to execute.
|
CountRequest |
source(byte[] querySource)
The source to execute.
|
CountRequest |
source(byte[] querySource,
int offset,
int length,
boolean unsafe)
The source to execute.
|
CountRequest |
source(BytesReference querySource,
boolean unsafe) |
CountRequest |
source(Map querySource)
The source to execute in the form of a map.
|
CountRequest |
source(QuerySourceBuilder sourceBuilder)
The source to execute.
|
CountRequest |
source(String querySource)
The source to execute.
|
CountRequest |
source(XContentBuilder builder) |
int |
terminateAfter() |
CountRequest |
terminateAfter(int terminateAfterCount)
Upon reaching
terminateAfter counts, the count request will early terminate |
String |
toString() |
String[] |
types()
The types of documents the query will run against.
|
CountRequest |
types(String... types)
The types of documents the query will run against.
|
ActionRequestValidationException |
validate() |
void |
writeTo(StreamOutput out) |
beforeLocalFork, indices, indices, indicesOptions, indicesOptions
listenerThreaded, listenerThreaded
getHeader, getHeaders, hasHeader, putHeader, remoteAddress, remoteAddress
contextSize, copyContextFrom, getContext, getFromContext, getFromContext, hasInContext, isContextEmpty, putAllInContext, putInContext
public static final float DEFAULT_MIN_SCORE
public CountRequest(String... indices)
public ActionRequestValidationException validate()
validate
in class BroadcastOperationRequest<CountRequest>
protected void beforeStart()
beforeStart
in class BroadcastOperationRequest<CountRequest>
public float minScore()
public CountRequest minScore(float minScore)
public BytesReference source()
public CountRequest source(QuerySourceBuilder sourceBuilder)
public CountRequest source(Map querySource)
public CountRequest source(XContentBuilder builder)
public CountRequest source(String querySource)
source(byte[])
or source(QuerySourceBuilder)
.public CountRequest source(byte[] querySource)
public CountRequest source(byte[] querySource, int offset, int length, boolean unsafe)
public CountRequest source(BytesReference querySource, boolean unsafe)
public String[] types()
public CountRequest types(String... types)
public String routing()
public CountRequest routing(String routing)
public CountRequest routing(String... routings)
public CountRequest preference(String preference)
public String preference()
public CountRequest terminateAfter(int terminateAfterCount)
terminateAfter
counts, the count request will early terminatepublic int terminateAfter()
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
readFrom
in class BroadcastOperationRequest<CountRequest>
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
writeTo
in class BroadcastOperationRequest<CountRequest>
IOException
Copyright © 2009–2015. All rights reserved.