Path parameters

  • indexstring | array[string] Required

    Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

Query parameters

  • indexstring | array[string]

    Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

  • If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcardsstring | array[string]

    Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

    Values are all, open, closed, hidden, or none.

  • fielddataboolean

    If true, clears the fields cache. Use the fields parameter to clear the cache of specific fields only.

  • fieldsstring | array[string]

    Comma-separated list of field names used to limit the fielddata parameter.

  • If false, the request returns an error if it targets a missing or closed index.

  • queryboolean

    If true, clears the query cache.

  • requestboolean

    If true, clears the request cache.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • _shardsobject
      Hide _shards attributes Show _shards attributes object
      • failednumber Required
      • successfulnumber Required
      • totalnumber Required
      • failuresarray[object]
        Hide failures attributes Show failures attributes object
        • indexstring
        • nodestring
        • reasonobject Required

          Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

          Hide reason attributes Show reason attributes object
          • typestring Required

            The type of error

          • reasonstring | null

            A human-readable explanation of the error, in English.

          • The server stack trace. Present only if the error_trace=true parameter was sent with the request.

          • caused_byobject

            Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

          • root_causearray[object]

            Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

            Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

          • suppressedarray[object]

            Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

            Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

        • shardnumber Required
        • statusstring
      • skippednumber
POST /{index}/_cache/clear
POST /my-index-000001,my-index-000002/_cache/clear?request=true
resp = client.indices.clear_cache(
    index="my-index-000001,my-index-000002",
    request=True,
)
const response = await client.indices.clearCache({
  index: "my-index-000001,my-index-000002",
  request: "true",
});
response = client.indices.clear_cache(
  index: "my-index-000001,my-index-000002",
  request: "true"
)
$resp = $client->indices()->clearCache([
    "index" => "my-index-000001,my-index-000002",
    "request" => "true",
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001,my-index-000002/_cache/clear?request=true"