[[reference-search_shards]] //////// =========================================================================================================================== || || || || || || || ██████╗ ███████╗ █████╗ ██████╗ ███╗ ███╗███████╗ || || ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝ || || ██████╔╝█████╗ ███████║██║ ██║██╔████╔██║█████╗ || || ██╔══██╗██╔══╝ ██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ || || ██║ ██║███████╗██║ ██║██████╔╝██║ ╚═╝ ██║███████╗ || || ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝ || || || || || || 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 || || || || || || || =========================================================================================================================== //////// [discrete] [[client.searchShards]] === client.searchShards Get the search shards. Get the indices and shards that a search request would be run against. This information can be useful for working out issues or planning optimizations with routing and shard preferences. When filtered aliases are used, the filter is returned as part of the indices section. {ref}/search-shards.html[{es} documentation] [discrete] ==== Function signature [source,ts] ---- (SearchShardsRequest, options?): Promise ---- [discrete] ==== SearchShardsRequest [pass] ++++
++++
interface SearchShardsRequest extends <> {
  index?: <>
  allow_no_indices?: boolean
  expand_wildcards?: <>
  ignore_unavailable?: boolean
  local?: boolean
  preference?: string
  routing?: <>
}

[pass]
++++
++++ [discrete] ==== SearchShardsResponse [pass] ++++
++++
interface SearchShardsResponse {
  nodes: Record<<>, SearchShardsSearchShardsNodeAttributes>
  shards: <>[][]
  indices: Record<<>, SearchShardsShardStoreIndex>
}

[pass]
++++
++++