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 boolean
allShards()
Indicates whether the query should be validated on all shards instead of one random shardvoid
allShards(boolean allShards)
Indicates whether the query should be validated on all shards instead of one random shardboolean
explain()
Indicates if detailed information about query is requestedvoid
explain(boolean explain)
Indicate if detailed information about query is requestedQueryBuilder
query()
The query to validate.ValidateQueryRequest
query(QueryBuilder query)
void
readFrom(StreamInput in)
Set this object's fields from a StreamInput.boolean
rewrite()
Indicates whether the query should be rewritten into primitive queriesvoid
rewrite(boolean rewrite)
Indicates whether the query should be rewritten into primitive queriesjava.lang.String
toString()
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
java.lang.String[]
types()
The types of documents the query will run against.ValidateQueryRequest
types(java.lang.String... types)
The types of documents the query will run against.ActionRequestValidationException
validate()
void
writeTo(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:
validate
in 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:Streamable
Set this object's fields from a StreamInput.- Specified by:
readFrom
in interfaceStreamable
- Overrides:
readFrom
in classBroadcastRequest<ValidateQueryRequest>
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write this object's fields to a StreamOutput.- Specified by:
writeTo
in interfaceStreamable
- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classBroadcastRequest<ValidateQueryRequest>
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
-