{
  "search": {
    "documentation": {
      "url": "https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-search.html",
      "description": "Run a search"
    },
    "stability": "stable",
    "visibility": "public",
    "headers": {
      "accept": [
        "application/json"
      ],
      "content_type": [
        "application/json"
      ]
    },
    "url": {
      "paths": [
        {
          "path": "/_search",
          "methods": [
            "GET",
            "POST"
          ]
        },
        {
          "path": "/{index}/_search",
          "methods": [
            "GET",
            "POST"
          ],
          "parts": {
            "index": {
              "type": "list",
              "description": "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices"
            }
          }
        }
      ]
    },
    "params": {
      "analyzer": {
        "type": "string",
        "description": "The analyzer to use for the query string"
      },
      "analyze_wildcard": {
        "type": "boolean",
        "default": false,
        "description": "Specify whether wildcard and prefix queries should be analyzed (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
      },
      "default_operator": {
        "type": "enum",
        "options": [
          "and",
          "or"
        ],
        "default": "or",
        "description": "The default operator for query string query (AND or OR)"
      },
      "df": {
        "type": "string",
        "description": "The field to use as default where no field prefix is given in the query string"
      },
      "explain": {
        "type": "boolean",
        "default": false,
        "description": "Specify whether to return detailed information about score computation as part of a hit"
      },
      "stored_fields": {
        "type": "list",
        "description": "A comma-separated list of stored fields to return as part of a hit"
      },
      "docvalue_fields": {
        "type": "list",
        "description": "A comma-separated list of fields to return as the docvalue representation of a field for each hit"
      },
      "from": {
        "type": "int",
        "default": 0,
        "description": "Starting offset (default: 0)"
      },
      "force_synthetic_source": {
        "type": "boolean",
        "description": "Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index.",
        "visibility": "feature_flag",
        "feature_flag": "es.index_mode_feature_flag_registered"
      },
      "ignore_unavailable": {
        "type": "boolean",
        "default": false,
        "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)"
      },
      "ignore_throttled": {
        "deprecated": {
          "version": "7.16.0",
          "description": "This parameter is deprecated because frozen indices have been deprecated."
        },
        "type": "boolean",
        "default": true,
        "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled"
      },
      "allow_no_indices": {
        "type": "boolean",
        "default": true,
        "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"
      },
      "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."
      },
      "lenient": {
        "type": "boolean",
        "default": false,
        "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored"
      },
      "preference": {
        "type": "string",
        "description": "Specify the node or shard the operation should be performed on (default: random)"
      },
      "q": {
        "type": "string",
        "description": "Query in the Lucene query string syntax"
      },
      "routing": {
        "type": "list",
        "description": "A comma-separated list of specific routing values"
      },
      "scroll": {
        "type": "time",
        "description": "Specify how long a consistent view of the index should be maintained for scrolled search"
      },
      "search_type": {
        "type": "enum",
        "options": [
          "query_then_fetch",
          "dfs_query_then_fetch"
        ],
        "description": "Search operation type"
      },
      "size": {
        "type": "int",
        "default": 10,
        "description": "Number of hits to return (default: 10)"
      },
      "sort": {
        "type": "list",
        "description": "A comma-separated list of <field>:<direction> pairs"
      },
      "_source": {
        "type": "list",
        "default": "true",
        "description": "True or false to return the _source field or not, or a list of fields to return"
      },
      "_source_excludes": {
        "type": "list",
        "description": "A list of fields to exclude from the returned _source field"
      },
      "_source_includes": {
        "type": "list",
        "description": "A list of fields to extract and return from the _source field"
      },
      "terminate_after": {
        "type": "long",
        "default": 0,
        "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early."
      },
      "stats": {
        "type": "list",
        "description": "Specific 'tag' of the request for logging and statistical purposes"
      },
      "suggest_field": {
        "type": "string",
        "description": "Specify which field to use for suggestions"
      },
      "suggest_mode": {
        "type": "enum",
        "options": [
          "missing",
          "popular",
          "always"
        ],
        "default": "missing",
        "description": "Specify suggest mode"
      },
      "suggest_size": {
        "type": "long",
        "description": "How many suggestions to return in response"
      },
      "suggest_text": {
        "type": "string",
        "description": "The source text for which the suggestions should be returned"
      },
      "timeout": {
        "type": "time",
        "description": "Explicit operation timeout"
      },
      "track_scores": {
        "type": "boolean",
        "default": false,
        "description": "Whether to calculate and return scores even if they are not used for sorting"
      },
      "track_total_hits": {
        "type": "boolean|long",
        "default": "10000",
        "description": "Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number."
      },
      "allow_partial_search_results": {
        "type": "boolean",
        "default": true,
        "description": "Indicate if an error should be returned if there is a partial search failure or timeout"
      },
      "typed_keys": {
        "type": "boolean",
        "default": false,
        "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response"
      },
      "version": {
        "type": "boolean",
        "default": false,
        "description": "Specify whether to return document version as part of a hit"
      },
      "seq_no_primary_term": {
        "type": "boolean",
        "description": "Specify whether to return sequence number and primary term of the last modification of each hit"
      },
      "request_cache": {
        "type": "boolean",
        "description": "Specify if request cache should be used for this request or not, defaults to index level setting"
      },
      "batched_reduce_size": {
        "type": "long",
        "description": "The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.",
        "default": 512
      },
      "max_concurrent_shard_requests": {
        "type": "int",
        "description": "The number of concurrent shard requests per node this search executes concurrently. 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
      },
      "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."
      },
      "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
      },
      "min_compatible_shard_node": {
        "type": "string",
        "description": "The minimum compatible version that all shards involved in search should have for this request to be successful"
      },
      "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 search definition using the Query DSL",
      "required": false
    }
  }
}
