Class ValidateQueryRequest

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

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

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

  • 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)
    • types

      @Deprecated public String[] types()
      Deprecated.
      Types are in the process of being removed. Instead of using a type, prefer to filter on a field on the document.
      The types of documents the query will run against. Defaults to all types.
    • types

      @Deprecated public ValidateQueryRequest types(String... types)
      Deprecated.
      Types are in the process of being removed. Instead of using a type, prefer to filter on a field on the document.
      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
    • 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.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      IOException