Class ValidateQueryRequest

All Implemented Interfaces:
IndicesRequest, IndicesRequest.Replaceable, Writeable, org.elasticsearch.core.RefCounted, TaskAwareRequest, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public class ValidateQueryRequest extends BroadcastRequest<ValidateQueryRequest> implements org.elasticsearch.xcontent.ToXContentObject
A request to validate a specific query.

The request requires the query to be set using query(QueryBuilder)

  • Field Details

    • DEFAULT_INDICES_OPTIONS

      public static final IndicesOptions DEFAULT_INDICES_OPTIONS
  • Constructor Details

    • ValidateQueryRequest

      public ValidateQueryRequest()
    • ValidateQueryRequest

      public ValidateQueryRequest(StreamInput in) throws IOException
      Throws:
      IOException
    • ValidateQueryRequest

      public ValidateQueryRequest(String... indices)
      Constructs a new validate request against the provided indices. No indices provided means it will run against all indices.
  • Method Details

    • validate

      Overrides:
      validate in class BroadcastRequest<ValidateQueryRequest>
    • query

      public QueryBuilder query()
      The query to validate.
    • query

      public ValidateQueryRequest query(QueryBuilder query)
    • 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
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class BroadcastRequest<ValidateQueryRequest>
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class TransportRequest
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException