Class ValidateQueryRequest

All Implemented Interfaces:
IndicesRequest, IndicesRequest.Replaceable, Writeable, org.elasticsearch.common.util.concurrent.RefCounted, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject, 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 java.io.IOException
      Throws:
      java.io.IOException
    • ValidateQueryRequest

      public ValidateQueryRequest​(java.lang.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 java.lang.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​(java.lang.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 java.io.IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class BroadcastRequest<ValidateQueryRequest>
      Throws:
      java.io.IOException
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • toXContent

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