[[reference-indices-validate_query]]

////////
===========================================================================================================================
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
||        ██████╗ ███████╗ █████╗ ██████╗ ███╗   ███╗███████╗                                                            ||
||        ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝                                                            ||
||        ██████╔╝█████╗  ███████║██║  ██║██╔████╔██║█████╗                                                              ||
||        ██╔══██╗██╔══╝  ██╔══██║██║  ██║██║╚██╔╝██║██╔══╝                                                              ||
||        ██║  ██║███████╗██║  ██║██████╔╝██║ ╚═╝ ██║███████╗                                                            ||
||        ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚═╝     ╚═╝╚══════╝                                                            ||
||                                                                                                                       ||
||                                                                                                                       ||
||    This file is autogenerated, DO NOT send pull requests that changes this file directly.                             ||
||    You should update the script that does the generation, which can be found in:                                      ||
||    https://github.com/elastic/elastic-client-generator-js                                                             ||
||                                                                                                                       ||
||    You can run the script with the following command:                                                                 ||
||       npm run elasticsearch -- --version <version>                                                                    ||
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
===========================================================================================================================
////////

[discrete]
=== client.indices.validateQuery

Validate a query. Validates a query without running it.

{ref}/search-validate.html[{es} documentation]

[discrete]
==== Function signature

[source,ts]
----
(IndicesValidateQueryRequest, options?): Promise<IndicesValidateQueryResponse>
----

[discrete]
===== `IndicesValidateQueryRequest`

[source,ts]
----
interface IndicesValidateQueryRequest extends <<shared-type-request-base, RequestBase>> {
  index?: <<shared-type-indices, Indices>>
  allow_no_indices?: boolean
  all_shards?: boolean
  analyzer?: string
  analyze_wildcard?: boolean
  default_operator?: QueryDslOperator
  df?: string
  expand_wildcards?: <<shared-type-expand-wildcards, ExpandWildcards>>
  explain?: boolean
  ignore_unavailable?: boolean
  lenient?: boolean
  rewrite?: boolean
  q?: string
  query?: QueryDslQueryContainer
}
----

[discrete]
===== `IndicesValidateQueryResponse`

[source,ts]
----
interface IndicesValidateQueryResponse {
  explanations?: IndicesValidateQueryIndicesValidationExplanation[]
  _shards?: <<shared-type-shard-statistics, ShardStatistics>>
  valid: boolean
  error?: string
}
----

