{
  "msearch": {
    "documentation": {
      "url": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-msearch",
      "description": "Run multiple searches"
    },
    "stability": "stable",
    "visibility": "public",
    "headers": {
      "accept": [
        "application/json"
      ],
      "content_type": [
        "application/x-ndjson"
      ]
    },
    "url": {
      "paths": [
        {
          "path": "/_msearch",
          "methods": [
            "GET",
            "POST"
          ]
        },
        {
          "path": "/{index}/_msearch",
          "methods": [
            "GET",
            "POST"
          ],
          "parts": {
            "index": {
              "type": "list",
              "description": "A comma-separated list of index names to use as default"
            }
          }
        }
      ]
    },
    "params": {
      "search_type": {
        "type": "enum",
        "options": [
          "query_then_fetch",
          "dfs_query_then_fetch"
        ],
        "description": "Search operation type"
      },
      "max_concurrent_searches": {
        "type": "int",
        "description": "Controls the maximum number of concurrent searches the multi search api will execute"
      },
      "typed_keys": {
        "type": "boolean",
        "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response"
      },
      "pre_filter_shard_size": {
        "type": "long",
        "description": "A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint."
      },
      "max_concurrent_shard_requests": {
        "type": "int",
        "description": "The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests",
        "default": 5
      },
      "rest_total_hits_as_int": {
        "type": "boolean",
        "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response",
        "default": false
      },
      "ccs_minimize_roundtrips": {
        "type": "boolean",
        "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution",
        "default": true
      },
      "index": {
        "type": "list",
        "description": "A comma-separated list of index names to use as default"
      },
      "ignore_unavailable": {
        "type": "boolean",
        "default": false,
        "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)"
      },
      "ignore_throttled": {
        "type": "boolean",
        "deprecated": {
          "version": "7.16.0",
          "description": "This parameter is deprecated because frozen indices have been deprecated."
        },
        "default": false,
        "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled"
      },
      "allow_no_indices": {
        "type": "boolean",
        "description": "Whether to allow (1) wildcard index expressions that match no indices and (2) requests where the final resolved set is empty."
      },
      "expand_wildcards": {
        "type": "list",
        "options": [
          "open",
          "closed",
          "hidden",
          "none",
          "all"
        ],
        "default": "open",
        "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both."
      },
      "project_routing": {
        "type": "string",
        "description": "A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless."
      },
      "routing": {
        "type": "list",
        "description": "A comma-separated list of specific routing values"
      },
      "include_named_queries_score": {
        "type": "boolean",
        "description": "Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false)",
        "default": false
      }
    },
    "body": {
      "description": "The request definitions (metadata-search request definition pairs), separated by newlines",
      "required": true,
      "serialize": "bulk"
    }
  }
}
