Class ValidateQueryRequest
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportRequest
-
- org.elasticsearch.action.ActionRequest
-
- org.elasticsearch.action.support.broadcast.BroadcastRequest<ValidateQueryRequest>
-
- org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequest
-
- All Implemented Interfaces:
IndicesRequest,IndicesRequest.Replaceable,Streamable,Writeable,ToXContent,ToXContentObject,TaskAwareRequest
public class ValidateQueryRequest extends BroadcastRequest<ValidateQueryRequest> implements ToXContentObject
A request to validate a specific query.The request requires the query to be set using
query(QueryBuilder)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
-
Nested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequest
IndicesRequest.Replaceable
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.action.support.broadcast.BroadcastRequest
indices
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description ValidateQueryRequest()ValidateQueryRequest(java.lang.String... indices)Constructs a new validate request against the provided indices.
-
Method Summary
Modifier and Type Method Description booleanallShards()Indicates whether the query should be validated on all shards instead of one random shardvoidallShards(boolean allShards)Indicates whether the query should be validated on all shards instead of one random shardbooleanexplain()Indicates if detailed information about query is requestedvoidexplain(boolean explain)Indicate if detailed information about query is requestedQueryBuilderquery()The query to validate.ValidateQueryRequestquery(QueryBuilder query)voidreadFrom(StreamInput in)Set this object's fields from a StreamInput.booleanrewrite()Indicates whether the query should be rewritten into primitive queriesvoidrewrite(boolean rewrite)Indicates whether the query should be rewritten into primitive queriesjava.lang.StringtoString()XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)java.lang.String[]types()The types of documents the query will run against.ValidateQueryRequesttypes(java.lang.String... types)The types of documents the query will run against.ActionRequestValidationExceptionvalidate()voidwriteTo(StreamOutput out)Write this object's fields to a StreamOutput.-
Methods inherited from class org.elasticsearch.action.support.broadcast.BroadcastRequest
indices, indices, indicesOptions, indicesOptions
-
Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResult
-
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask
-
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Method Detail
-
validate
public ActionRequestValidationException validate()
- Overrides:
validatein classBroadcastRequest<ValidateQueryRequest>
-
query
public QueryBuilder query()
The query to validate.
-
query
public ValidateQueryRequest query(QueryBuilder query)
-
types
public java.lang.String[] types()
The types of documents the query will run against. Defaults to all types.
-
types
public ValidateQueryRequest types(java.lang.String... types)
The types of documents the query will run against. Defaults to all types.
-
explain
public void explain(boolean explain)
Indicate if detailed information about query is requested
-
explain
public boolean explain()
Indicates if detailed information about query is requested
-
rewrite
public void rewrite(boolean rewrite)
Indicates whether the query should be rewritten into primitive queries
-
rewrite
public boolean rewrite()
Indicates whether the query should be rewritten into primitive queries
-
allShards
public void allShards(boolean allShards)
Indicates whether the query should be validated on all shards instead of one random shard
-
allShards
public boolean allShards()
Indicates whether the query should be validated on all shards instead of one random shard
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:StreamableSet this object's fields from a StreamInput.- Specified by:
readFromin interfaceStreamable- Overrides:
readFromin classBroadcastRequest<ValidateQueryRequest>- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:StreamableWrite this object's fields to a StreamOutput.- Specified by:
writeToin interfaceStreamable- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classBroadcastRequest<ValidateQueryRequest>- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-
-