Get anomaly detection jobs Added in 7.7.0

GET /_cat/ml/anomaly_detectors/{job_id}

Get configuration and usage information for anomaly detection jobs. This API returns a maximum of 10,000 jobs. If the Elasticsearch security features are enabled, you must have monitor_ml, monitor, manage_ml, or manage cluster privileges to use this API.

IMPORTANT: CAT APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get anomaly detection job statistics API.

Path parameters

  • job_id string Required

    Identifier for the anomaly detection job.

Query parameters

  • Specifies what to do when the request:

    • Contains wildcard expressions and there are no jobs that match.
    • Contains the _all string or no identifiers and there are no matches.
    • Contains wildcard expressions and there are only partial matches.

    If true, the API returns an empty jobs array when there are no matches and the subset of results when there are partial matches. If false, the API returns a 404 status code when there are no matches or only partial matches.

  • bytes string

    The unit used to display byte values.

    Values are b, kb, mb, gb, tb, or pb.

  • h string | array[string]

    Comma-separated list of column names to display.

  • s string | array[string]

    Comma-separated list of column names or column aliases used to sort the response.

  • time string

    The unit used to display time values.

    Values are nanos, micros, ms, s, m, h, or d.

Responses

  • Hide response attributes Show response attributes object
    • id string
    • state string

      Values are closing, closed, opened, failed, or opening.

    • For open jobs only, the amount of time the job has been opened.

    • For open anomaly detection jobs only, contains messages relating to the selection of a node to run the job.

    • The number of input documents that have been processed by the anomaly detection job. This value includes documents with missing fields, since they are nonetheless analyzed. If you use datafeeds and have aggregations in your search query, the processed_record_count is the number of aggregation results processed, not the number of Elasticsearch documents.

    • The total number of fields in all the documents that have been processed by the anomaly detection job. Only fields that are specified in the detector configuration object contribute to this count. The timestamp is not included in this count.

    • The number of input documents posted to the anomaly detection job.

    • The total number of fields in input documents posted to the anomaly detection job. This count includes fields that are not used in the analysis. However, be aware that if you are using a datafeed, it extracts only the required fields from the documents it retrieves before posting them to the job.

    • The number of input documents with either a missing date field or a date that could not be parsed.

    • The number of input documents that are missing a field that the anomaly detection job is configured to analyze. Input documents with missing fields are still processed because it is possible that not all fields are missing. If you are using datafeeds or posting data to the job in JSON format, a high missing_field_count is often not an indication of data issues. It is not necessarily a cause for concern.

    • The number of input documents that have a timestamp chronologically preceding the start of the current anomaly detection bucket offset by the latency window. This information is applicable only when you provide data to the anomaly detection job by using the post data API. These out of order documents are discarded, since jobs require time series data to be in ascending chronological order.

    • The number of buckets which did not contain any data. If your data contains many empty buckets, consider increasing your bucket_span or using functions that are tolerant to gaps in data such as mean, non_null_sum or non_zero_count.

    • The number of buckets that contained few data points compared to the expected number of data points. If your data contains many sparse buckets, consider using a longer bucket_span.

    • The total number of buckets processed.

    • The timestamp of the earliest chronologically input document.

    • The timestamp of the latest chronologically input document.

    • The timestamp at which data was last analyzed, according to server time.

    • The timestamp of the last bucket that did not contain any data.

    • The timestamp of the last bucket that was considered sparse.

    • Values are ok, soft_limit, or hard_limit.

    • The upper limit for model memory usage, checked on increasing values.

    • The number of by field values that were analyzed by the models. This value is cumulative for all detectors in the job.

    • The number of over field values that were analyzed by the models. This value is cumulative for all detectors in the job.

    • The number of partition field values that were analyzed by the models. This value is cumulative for all detectors in the job.

    • The number of buckets for which new entities in incoming data were not processed due to insufficient model memory. This situation is also signified by a hard_limit: memory_status property value.

    • Values are ok or warn.

    • The number of documents that have had a field categorized.

    • The number of categories created by categorization.

    • The number of categories that match more than 1% of categorized documents.

    • The number of categories that match just one categorized document.

    • The number of categories created by categorization that will never be assigned again because another category’s definition makes it a superset of the dead category. Dead categories are a side effect of the way categorization has no prior training.

    • The number of times that categorization wanted to create a new category but couldn’t because the job had hit its model_memory_limit. This count does not track which specific categories failed to be created. Therefore you cannot use this value to determine the number of unique categories that were missed.

    • The timestamp when the model stats were gathered, according to server time.

    • The timestamp of the last record when the model stats were gathered.

    • The number of individual forecasts currently available for the job. A value of one or more indicates that forecasts exist.

    • The minimum memory usage in bytes for forecasts related to the anomaly detection job.

    • The maximum memory usage in bytes for forecasts related to the anomaly detection job.

    • The average memory usage in bytes for forecasts related to the anomaly detection job.

    • The total memory usage in bytes for forecasts related to the anomaly detection job.

    • The minimum number of model_forecast documents written for forecasts related to the anomaly detection job.

    • The maximum number of model_forecast documents written for forecasts related to the anomaly detection job.

    • The average number of model_forecast documents written for forecasts related to the anomaly detection job.

    • The total number of model_forecast documents written for forecasts related to the anomaly detection job.

    • The minimum runtime in milliseconds for forecasts related to the anomaly detection job.

    • The maximum runtime in milliseconds for forecasts related to the anomaly detection job.

    • The average runtime in milliseconds for forecasts related to the anomaly detection job.

    • The total runtime in milliseconds for forecasts related to the anomaly detection job.

    • node.id string
    • The name of the assigned node.

    • The network address of the assigned node.

    • The number of bucket results produced by the job.

    • The sum of all bucket processing times, in milliseconds.

    • The minimum of all bucket processing times, in milliseconds.

    • The maximum of all bucket processing times, in milliseconds.

    • The exponential moving average of all bucket processing times, in milliseconds.

    • The exponential moving average of bucket processing times calculated in a one hour time window, in milliseconds.

GET /_cat/ml/anomaly_detectors/{job_id}
curl \
 -X GET http://api.example.com/_cat/ml/anomaly_detectors/{job_id}
Response examples (200)
[
  {
    "id": "string",
    "state": "closing",
    "opened_time": "string",
    "assignment_explanation": "string",
    "data.processed_records": "string",
    "data.processed_fields": "string",
    "": 42.0,
    "data.input_records": "string",
    "data.input_fields": "string",
    "data.invalid_dates": "string",
    "data.missing_fields": "string",
    "data.out_of_order_timestamps": "string",
    "data.empty_buckets": "string",
    "data.sparse_buckets": "string",
    "data.buckets": "string",
    "data.earliest_record": "string",
    "data.latest_record": "string",
    "data.last": "string",
    "data.last_empty_bucket": "string",
    "data.last_sparse_bucket": "string",
    "model.memory_status": "ok",
    "model.memory_limit": "string",
    "model.by_fields": "string",
    "model.over_fields": "string",
    "model.partition_fields": "string",
    "model.bucket_allocation_failures": "string",
    "model.categorization_status": "ok",
    "model.categorized_doc_count": "string",
    "model.total_category_count": "string",
    "model.frequent_category_count": "string",
    "model.rare_category_count": "string",
    "model.dead_category_count": "string",
    "model.failed_category_count": "string",
    "model.log_time": "string",
    "model.timestamp": "string",
    "forecasts.total": "string",
    "forecasts.memory.min": "string",
    "forecasts.memory.max": "string",
    "forecasts.memory.avg": "string",
    "forecasts.memory.total": "string",
    "forecasts.records.min": "string",
    "forecasts.records.max": "string",
    "forecasts.records.avg": "string",
    "forecasts.records.total": "string",
    "forecasts.time.min": "string",
    "forecasts.time.max": "string",
    "forecasts.time.avg": "string",
    "forecasts.time.total": "string",
    "node.id": "string",
    "node.name": "string",
    "node.ephemeral_id": "string",
    "node.address": "string",
    "buckets.count": "string",
    "buckets.time.total": "string",
    "buckets.time.min": "string",
    "buckets.time.max": "string",
    "buckets.time.exp_avg": "string",
    "buckets.time.exp_avg_hour": "string"
  }
]

Get trained models Added in 7.7.0

GET /_cat/ml/trained_models

Get configuration and usage information about inference trained models.

IMPORTANT: CAT APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get trained models statistics API.

Query parameters

  • Specifies what to do when the request: contains wildcard expressions and there are no models that match; contains the _all string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. If true, the API returns an empty array when there are no matches and the subset of results when there are partial matches. If false, the API returns a 404 status code when there are no matches or only partial matches.

  • bytes string

    The unit used to display byte values.

    Values are b, kb, mb, gb, tb, or pb.

  • h string | array[string]

    A comma-separated list of column names to display.

  • s string | array[string]

    A comma-separated list of column names or aliases used to sort the response.

  • from number

    Skips the specified number of transforms.

  • size number

    The maximum number of transforms to display.

  • time string

    Unit used to display time values.

    Values are nanos, micros, ms, s, m, h, or d.

Responses

GET /_cat/ml/trained_models
curl \
 -X GET http://api.example.com/_cat/ml/trained_models
Response examples (200)
[
  {
    "id": "string",
    "created_by": "string",
    "": "string",
    "operations": "string",
    "license": "string",
    "version": "string",
    "description": "string",
    "ingest.pipelines": "string",
    "ingest.count": "string",
    "ingest.time": "string",
    "ingest.current": "string",
    "ingest.failed": "string",
    "data_frame.id": "string",
    "data_frame.create_time": "string",
    "data_frame.source_index": "string",
    "data_frame.analysis": "string",
    "type": "string"
  }
]




Get node attribute information

GET /_cat/nodeattrs

Get information about custom node attributes. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.

Query parameters

  • local boolean

    If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • Period to wait for a connection to the master node.

Responses

GET /_cat/nodeattrs
curl \
 -X GET http://api.example.com/_cat/nodeattrs
Response examples (200)
[
  {
    "node": "string",
    "id": "string",
    "pid": "string",
    "host": "string",
    "ip": "string",
    "port": "string",
    "attr": "string",
    "value": "string"
  }
]












Get shard recovery information

GET /_cat/recovery

Get information about ongoing and completed shard recoveries. Shard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or syncing a replica shard from a primary shard. When a shard recovery completes, the recovered shard is available for search and indexing. For data streams, the API returns information about the stream’s backing indices. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index recovery API.

Query parameters

  • If true, the response only includes ongoing shard recoveries.

  • bytes string

    The unit used to display byte values.

    Values are b, kb, mb, gb, tb, or pb.

  • detailed boolean

    If true, the response includes detailed information about shard recoveries.

  • time string

    Unit used to display time values.

    Values are nanos, micros, ms, s, m, h, or d.

Responses

GET /_cat/recovery
curl \
 -X GET http://api.example.com/_cat/recovery
Response examples (200)
[
  {
    "index": "string",
    "shard": "string",
    "": "string",
    "time": "string",
    "type": "string",
    "stage": "string",
    "source_host": "string",
    "source_node": "string",
    "target_host": "string",
    "target_node": "string",
    "repository": "string",
    "snapshot": "string",
    "files": "string",
    "files_recovered": "string",
    "files_total": "string",
    "bytes": "string",
    "bytes_recovered": "string",
    "bytes_total": "string",
    "translog_ops": "string",
    "translog_ops_recovered": "string"
  }
]













































































Get cluster-wide settings

GET /_cluster/settings

By default, it returns only settings that have been explicitly defined.

Query parameters

  • If true, returns settings in flat format.

  • If true, returns default cluster settings from the local node.

  • Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout string

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • persistent object Required
      Hide persistent attribute Show persistent attribute object
      • * object Additional properties

        Additional properties are allowed.

    • transient object Required
      Hide transient attribute Show transient attribute object
      • * object Additional properties

        Additional properties are allowed.

    • defaults object
      Hide defaults attribute Show defaults attribute object
      • * object Additional properties

        Additional properties are allowed.

GET /_cluster/settings
curl \
 -X GET http://api.example.com/_cluster/settings
Response examples (200)
{
  "persistent": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "transient": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "defaults": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  }
}
























Reroute the cluster Added in 5.0.0

POST /_cluster/reroute

Manually change the allocation of individual shards in the cluster. For example, a shard can be moved from one node to another explicitly, an allocation can be canceled, and an unassigned shard can be explicitly allocated to a specific node.

It is important to note that after processing any reroute commands Elasticsearch will perform rebalancing as normal (respecting the values of settings such as cluster.routing.rebalance.enable) in order to remain in a balanced state. For example, if the requested allocation includes moving a shard from node1 to node2 then this may cause a shard to be moved from node2 back to node1 to even things out.

The cluster can be set to disable allocations using the cluster.routing.allocation.enable setting. If allocations are disabled then the only allocations that will be performed are explicit ones given using the reroute command, and consequent allocations due to rebalancing.

The cluster will attempt to allocate a shard a maximum of index.allocation.max_retries times in a row (defaults to 5), before giving up and leaving the shard unallocated. This scenario can be caused by structural problems such as having an analyzer which refers to a stopwords file which doesn’t exist on all nodes.

Once the problem has been corrected, allocation can be manually retried by calling the reroute API with the ?retry_failed URI query parameter, which will attempt a single retry round for these shards.

Query parameters

  • dry_run boolean

    If true, then the request simulates the operation. It will calculate the result of applying the commands to the current cluster state and return the resulting cluster state after the commands (and rebalancing) have been applied; it will not actually perform the requested changes.

  • explain boolean

    If true, then the response contains an explanation of why the commands can or cannot run.

  • metric string | array[string]

    Limits the information returned to the specified metrics.

  • If true, then retries allocation of shards that are blocked due to too many subsequent allocation failures.

  • Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout string

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

application/json

Body

  • commands array[object]

    Defines the commands to perform.

    Hide commands attributes Show commands attributes object
    • cancel object

      Additional properties are allowed.

      Hide cancel attributes Show cancel attributes object
    • move object

      Additional properties are allowed.

      Hide move attributes Show move attributes object
    • Additional properties are allowed.

      Hide allocate_replica attributes Show allocate_replica attributes object
    • Additional properties are allowed.

      Hide allocate_stale_primary attributes Show allocate_stale_primary attributes object
      • index string Required
      • shard number Required
      • node string Required
      • accept_data_loss boolean Required

        If a node which has a copy of the data rejoins the cluster later on, that data will be deleted. To ensure that these implications are well-understood, this command requires the flag accept_data_loss to be explicitly set to true

    • Additional properties are allowed.

      Hide allocate_empty_primary attributes Show allocate_empty_primary attributes object
      • index string Required
      • shard number Required
      • node string Required
      • accept_data_loss boolean Required

        If a node which has a copy of the data rejoins the cluster later on, that data will be deleted. To ensure that these implications are well-understood, this command requires the flag accept_data_loss to be explicitly set to true

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • acknowledged boolean Required
    • explanations array[object]
      Hide explanations attributes Show explanations attributes object
    • state object

      There aren't any guarantees on the output/structure of the raw cluster state. Here you will find the internal representation of the cluster, which can differ from the external representation.

      Additional properties are allowed.

POST /_cluster/reroute
curl \
 -X POST http://api.example.com/_cluster/reroute \
 -H "Content-Type: application/json" \
 -d '"{\n  \"commands\": [\n    {\n      \"move\": {\n        \"index\": \"test\", \"shard\": 0,\n        \"from_node\": \"node1\", \"to_node\": \"node2\"\n      }\n    },\n    {\n      \"allocate_replica\": {\n        \"index\": \"test\", \"shard\": 1,\n        \"node\": \"node3\"\n      }\n    }\n  ]\n}"'
Request example
Run `POST /_cluster/reroute?metric=none` to changes the allocation of shards in a cluster.
{
  "commands": [
    {
      "move": {
        "index": "test", "shard": 0,
        "from_node": "node1", "to_node": "node2"
      }
    },
    {
      "allocate_replica": {
        "index": "test", "shard": 1,
        "node": "node3"
      }
    }
  ]
}
Response examples (200)
{
  "acknowledged": true,
  "explanations": [
    {
      "command": "string",
      "decisions": [
        {
          "decider": "string",
          "decision": "string",
          "explanation": "string"
        }
      ],
      "parameters": {
        "allow_primary": true,
        "index": "string",
        "node": "string",
        "shard": 42.0,
        "from_node": "string",
        "to_node": "string"
      }
    }
  ],
  "state": {}
}
































































Get node statistics

GET /_nodes/stats

Get statistics for nodes in a cluster. By default, all stats are returned. You can limit the returned information by using metrics.

Query parameters

  • completion_fields string | array[string]

    Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics.

  • fielddata_fields string | array[string]

    Comma-separated list or wildcard expressions of fields to include in fielddata statistics.

  • fields string | array[string]

    Comma-separated list or wildcard expressions of fields to include in the statistics.

  • groups boolean

    Comma-separated list of search groups to include in the search statistics.

  • If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).

  • level string

    Indicates whether statistics are aggregated at the cluster, index, or shard level.

    Values are cluster, indices, or shards.

  • Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout string

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • types array[string]

    A comma-separated list of document types for the indexing index metric.

  • If true, the response includes information from segments that are not loaded into memory.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • _nodes object

      Additional properties are allowed.

      Hide _nodes attributes Show _nodes attributes object
      • failures array[object]
        Hide failures attributes Show failures attributes object
        • type string Required

          The type of error

        • reason string

          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.

        • Additional properties are allowed.

        • root_cause array[object]

          Additional properties are allowed.

        • suppressed array[object]

          Additional properties are allowed.

      • total number Required

        Total number of nodes selected by the request.

      • successful number Required

        Number of nodes that responded successfully to the request.

      • failed number Required

        Number of nodes that rejected the request or failed to respond. If this value is not 0, a reason for the rejection or failure is included in the response.

    • nodes object Required
      Hide nodes attribute Show nodes attribute object
      • * object Additional properties

        Additional properties are allowed.

        Hide * attributes Show * attributes object
        • Statistics about adaptive replica selection.

          Hide adaptive_selection attribute Show adaptive_selection attribute object
          • * object Additional properties

            Additional properties are allowed.

            Hide * attributes Show * attributes object
            • The exponentially weighted moving average queue size of search requests on the keyed node.

            • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

            • The exponentially weighted moving average response time, in nanoseconds, of search requests on the keyed node.

            • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

            • The exponentially weighted moving average service time, in nanoseconds, of search requests on the keyed node.

            • The number of outstanding search requests to the keyed node from the node these stats are for.

            • rank string

              The rank of this node; used for shard selection when routing search requests.

        • breakers object

          Statistics about the field data circuit breaker.

          Hide breakers attribute Show breakers attribute object
          • * object Additional properties

            Additional properties are allowed.

            Hide * attributes Show * attributes object
            • Estimated memory used for the operation.

            • Estimated memory used, in bytes, for the operation.

            • Memory limit for the circuit breaker.

            • Memory limit, in bytes, for the circuit breaker.

            • overhead number

              A constant that all estimates for the circuit breaker are multiplied with to calculate a final estimate.

            • tripped number

              Total number of times the circuit breaker has been triggered and prevented an out of memory error.

        • fs object

          Additional properties are allowed.

          Hide fs attributes Show fs attributes object
          • data array[object]

            List of all file stores.

            Additional properties are allowed.

          • Last time the file stores statistics were refreshed. Recorded in milliseconds since the Unix Epoch.

          • total object

            Additional properties are allowed.

            Hide total attributes Show total attributes object
            • Total disk space available to this Java virtual machine on all file stores. Depending on OS or process level restrictions, this might appear less than free. This is the actual amount of free disk space the Elasticsearch node can utilise.

            • Total number of bytes available to this Java virtual machine on all file stores. Depending on OS or process level restrictions, this might appear less than free_in_bytes. This is the actual amount of free disk space the Elasticsearch node can utilise.

            • free string

              Total unallocated disk space in all file stores.

            • Total number of unallocated bytes in all file stores.

            • total string

              Total size of all file stores.

            • Total size of all file stores in bytes.

          • io_stats object

            Additional properties are allowed.

            Hide io_stats attributes Show io_stats attributes object
            • devices array[object]

              Array of disk metrics for each device that is backing an Elasticsearch data path. These disk metrics are probed periodically and averages between the last probe and the current probe are computed.

            • total object

              Additional properties are allowed.

        • host string
        • http object

          Additional properties are allowed.

          Hide http attributes Show http attributes object
          • Current number of open HTTP connections for the node.

          • Total number of HTTP connections opened for the node.

          • clients array[object]

            Information on current and recently-closed HTTP client connections. Clients that have been closed longer than the http.client_stats.closed_channels.max_age setting will not be represented here.

            Additional properties are allowed.

          • routes object Required Added in 8.12.0

            Detailed HTTP stats broken down by route

            Hide routes attribute Show routes attribute object
            • * object Additional properties

              Additional properties are allowed.

        • ingest object

          Additional properties are allowed.

          Hide ingest attributes Show ingest attributes object
          • Contains statistics about ingest pipelines for the node.

            Hide pipelines attribute Show pipelines attribute object
            • * object Additional properties

              Additional properties are allowed.

          • total object

            Additional properties are allowed.

            Hide total attributes Show total attributes object
            • count number Required

              Total number of documents ingested during the lifetime of this node.

            • current number Required

              Total number of documents currently being ingested.

            • failed number Required

              Total number of failed ingest operations during the lifetime of this node.

        • ip string | array[string]

          IP address and port for the node.

        • jvm object

          Additional properties are allowed.

          Hide jvm attributes Show jvm attributes object
          • Contains statistics about JVM buffer pools for the node.

            Hide buffer_pools attribute Show buffer_pools attribute object
            • * object Additional properties

              Additional properties are allowed.

          • classes object

            Additional properties are allowed.

            Hide classes attributes Show classes attributes object
          • gc object

            Additional properties are allowed.

            Hide gc attribute Show gc attribute object
            • Contains statistics about JVM garbage collectors for the node.

          • mem object

            Additional properties are allowed.

            Hide mem attributes Show mem attributes object
          • threads object

            Additional properties are allowed.

            Hide threads attributes Show threads attributes object
            • count number

              Number of active threads in use by JVM.

            • Highest number of threads used by JVM.

          • Last time JVM statistics were refreshed.

          • uptime string

            Human-readable JVM uptime. Only returned if the human query parameter is true.

          • JVM uptime in milliseconds.

        • name string
        • os object

          Additional properties are allowed.

          Hide os attributes Show os attributes object
          • cpu object

            Additional properties are allowed.

            Hide cpu attributes Show cpu attributes object
            • percent number
            • sys string

              A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

            • total string

              A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

            • user string

              A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

          • mem object

            Additional properties are allowed.

          • swap object

            Additional properties are allowed.

            Hide swap attributes Show swap attributes object
          • cgroup object

            Additional properties are allowed.

            Hide cgroup attributes Show cgroup attributes object
            • cpuacct object

              Additional properties are allowed.

            • cpu object

              Additional properties are allowed.

            • memory object

              Additional properties are allowed.

        • process object

          Additional properties are allowed.

          Hide process attributes Show process attributes object
          • cpu object

            Additional properties are allowed.

            Hide cpu attributes Show cpu attributes object
            • percent number
            • sys string

              A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

            • total string

              A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

            • user string

              A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

          • mem object

            Additional properties are allowed.

            Hide mem attributes Show mem attributes object
          • Number of opened file descriptors associated with the current or -1 if not supported.

          • Maximum number of file descriptors allowed on the system, or -1 if not supported.

          • Last time the statistics were refreshed. Recorded in milliseconds since the Unix Epoch.

        • roles array[string]
          • @doc_id node-roles

          Values are master, data, data_cold, data_content, data_frozen, data_hot, data_warm, client, ingest, ml, voting_only, transform, remote_cluster_client, or coordinating_only.

        • script object

          Additional properties are allowed.

          Hide script attributes Show script attributes object
          • Total number of times the script cache has evicted old data.

          • Total number of inline script compilations performed by the node.

          • Contains this recent history of script compilations.

            Hide compilations_history attribute Show compilations_history attribute object
            • * number Additional properties
          • Total number of times the script compilation circuit breaker has limited inline script compilations.

          • contexts array[object]

            Additional properties are allowed.

        • Statistics about each thread pool, including current size, queue and rejected tasks.

          Hide thread_pool attribute Show thread_pool attribute object
          • * object Additional properties

            Additional properties are allowed.

            Hide * attributes Show * attributes object
            • active number

              Number of active threads in the thread pool.

            • Number of tasks completed by the thread pool executor.

            • largest number

              Highest number of active threads in the thread pool.

            • queue number

              Number of tasks in queue for the thread pool.

            • rejected number

              Number of tasks rejected by the thread pool executor.

            • threads number

              Number of threads in the thread pool.

        • Additional properties are allowed.

          Hide transport attributes Show transport attributes object
          • The distribution of the time spent handling each inbound message on a transport thread, represented as a histogram.

            Additional properties are allowed.

          • The distribution of the time spent sending each outbound transport message on a transport thread, represented as a histogram.

            Additional properties are allowed.

          • rx_count number

            Total number of RX (receive) packets received by the node during internal cluster communication.

          • rx_size string

            Size of RX packets received by the node during internal cluster communication.

          • Size, in bytes, of RX packets received by the node during internal cluster communication.

          • Current number of inbound TCP connections used for internal communication between nodes.

          • tx_count number

            Total number of TX (transmit) packets sent by the node during internal cluster communication.

          • tx_size string

            Size of TX packets sent by the node during internal cluster communication.

          • Size, in bytes, of TX packets sent by the node during internal cluster communication.

          • The cumulative number of outbound transport connections that this node has opened since it started. Each transport connection may comprise multiple TCP connections but is only counted once in this statistic. Transport connections are typically long-lived so this statistic should remain constant in a stable cluster.

        • Contains a list of attributes for the node.

          Hide attributes attribute Show attributes attribute object
          • * string Additional properties
        • Additional properties are allowed.

          Hide discovery attributes Show discovery attributes object
          • Additional properties are allowed.

            Hide cluster_state_queue attributes Show cluster_state_queue attributes object
            • total number

              Total number of cluster states in queue.

            • pending number

              Number of pending cluster states in queue.

            • Number of committed cluster states in queue.

          • Additional properties are allowed.

            Hide published_cluster_states attributes Show published_cluster_states attributes object
          • Contains low-level statistics about how long various activities took during cluster state updates while the node was the elected master. Omitted if the node is not master-eligible. Every field whose name ends in _time within this object is also represented as a raw number of milliseconds in a field whose name ends in _time_millis. The human-readable fields with a _time suffix are only returned if requested with the ?human=true query parameter.

            Hide cluster_state_update attribute Show cluster_state_update attribute object
            • * object Additional properties

              Additional properties are allowed.

          • Additional properties are allowed.

            Hide serialized_cluster_states attributes Show serialized_cluster_states attributes object
            • Additional properties are allowed.

            • diffs object

              Additional properties are allowed.

          • Additional properties are allowed.

            Hide cluster_applier_stats attribute Show cluster_applier_stats attribute object
        • Additional properties are allowed.

          Hide indexing_pressure attribute Show indexing_pressure attribute object
          • memory object

            Additional properties are allowed.

            Hide memory attributes Show memory attributes object
            • Configured memory limit, in bytes, for the indexing requests. Replica requests have an automatic limit that is 1.5x this value.

            • current object

              Additional properties are allowed.

            • total object

              Additional properties are allowed.

        • indices object

          Additional properties are allowed.

          Hide indices attributes Show indices attributes object
GET /_nodes/stats
curl \
 -X GET http://api.example.com/_nodes/stats
Response examples (200)
{
  "_nodes": {
    "failures": [
      {
        "type": "string",
        "reason": "string",
        "stack_trace": "string",
        "caused_by": {},
        "root_cause": [
          {}
        ],
        "suppressed": [
          {}
        ]
      }
    ],
    "total": 42.0,
    "successful": 42.0,
    "failed": 42.0
  },
  "cluster_name": "string",
  "nodes": {
    "additionalProperty1": {
      "adaptive_selection": {
        "additionalProperty1": {
          "avg_queue_size": 42.0,
          "avg_response_time": "string",
          "avg_response_time_ns": 42.0,
          "avg_service_time": "string",
          "avg_service_time_ns": 42.0,
          "outgoing_searches": 42.0,
          "rank": "string"
        },
        "additionalProperty2": {
          "avg_queue_size": 42.0,
          "avg_response_time": "string",
          "avg_response_time_ns": 42.0,
          "avg_service_time": "string",
          "avg_service_time_ns": 42.0,
          "outgoing_searches": 42.0,
          "rank": "string"
        }
      },
      "breakers": {
        "additionalProperty1": {
          "estimated_size": "string",
          "estimated_size_in_bytes": 42.0,
          "limit_size": "string",
          "limit_size_in_bytes": 42.0,
          "overhead": 42.0,
          "tripped": 42.0
        },
        "additionalProperty2": {
          "estimated_size": "string",
          "estimated_size_in_bytes": 42.0,
          "limit_size": "string",
          "limit_size_in_bytes": 42.0,
          "overhead": 42.0,
          "tripped": 42.0
        }
      },
      "fs": {
        "data": [
          {}
        ],
        "timestamp": 42.0,
        "total": {
          "available": "string",
          "available_in_bytes": 42.0,
          "free": "string",
          "free_in_bytes": 42.0,
          "total": "string",
          "total_in_bytes": 42.0
        },
        "io_stats": {
          "devices": [
            {}
          ],
          "total": {}
        }
      },
      "host": "string",
      "http": {
        "current_open": 42.0,
        "total_opened": 42.0,
        "clients": [
          {}
        ],
        "routes": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        }
      },
      "ingest": {
        "pipelines": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "total": {
          "count": 42.0,
          "current": 42.0,
          "failed": 42.0
        }
      },
      "ip": "string",
      "jvm": {
        "buffer_pools": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "classes": {
          "current_loaded_count": 42.0,
          "total_loaded_count": 42.0,
          "total_unloaded_count": 42.0
        },
        "gc": {
          "collectors": {}
        },
        "mem": {
          "heap_used_in_bytes": 42.0,
          "heap_used_percent": 42.0,
          "heap_committed_in_bytes": 42.0,
          "heap_max_in_bytes": 42.0,
          "non_heap_used_in_bytes": 42.0,
          "non_heap_committed_in_bytes": 42.0,
          "pools": {}
        },
        "threads": {
          "count": 42.0,
          "peak_count": 42.0
        },
        "timestamp": 42.0,
        "uptime": "string",
        "uptime_in_millis": 42.0
      },
      "name": "string",
      "os": {
        "cpu": {
          "percent": 42.0,
          "sys": "string",
          "total": "string",
          "user": "string",
          "load_average": {}
        },
        "": {},
        "swap": {
          "adjusted_total_in_bytes": 42.0,
          "resident": "string",
          "resident_in_bytes": 42.0,
          "share": "string",
          "share_in_bytes": 42.0,
          "total_virtual": "string",
          "total_virtual_in_bytes": 42.0,
          "total_in_bytes": 42.0,
          "free_in_bytes": 42.0,
          "used_in_bytes": 42.0
        },
        "cgroup": {
          "cpuacct": {},
          "cpu": {},
          "memory": {}
        },
        "timestamp": 42.0
      },
      "process": {
        "cpu": {
          "percent": 42.0,
          "sys": "string",
          "total": "string",
          "user": "string",
          "load_average": {}
        },
        "mem": {
          "adjusted_total_in_bytes": 42.0,
          "resident": "string",
          "resident_in_bytes": 42.0,
          "share": "string",
          "share_in_bytes": 42.0,
          "total_virtual": "string",
          "total_virtual_in_bytes": 42.0,
          "total_in_bytes": 42.0,
          "free_in_bytes": 42.0,
          "used_in_bytes": 42.0
        },
        "open_file_descriptors": 42.0,
        "max_file_descriptors": 42.0,
        "timestamp": 42.0
      },
      "roles": [
        "master"
      ],
      "script": {
        "cache_evictions": 42.0,
        "compilations": 42.0,
        "compilations_history": {
          "additionalProperty1": 42.0,
          "additionalProperty2": 42.0
        },
        "compilation_limit_triggered": 42.0,
        "contexts": [
          {}
        ]
      },
      "script_cache": {},
      "thread_pool": {
        "additionalProperty1": {
          "active": 42.0,
          "completed": 42.0,
          "largest": 42.0,
          "queue": 42.0,
          "rejected": 42.0,
          "threads": 42.0
        },
        "additionalProperty2": {
          "active": 42.0,
          "completed": 42.0,
          "largest": 42.0,
          "queue": 42.0,
          "rejected": 42.0,
          "threads": 42.0
        }
      },
      "timestamp": 42.0,
      "transport": {
        "inbound_handling_time_histogram": [
          {}
        ],
        "outbound_handling_time_histogram": [
          {}
        ],
        "rx_count": 42.0,
        "rx_size": "string",
        "rx_size_in_bytes": 42.0,
        "server_open": 42.0,
        "tx_count": 42.0,
        "tx_size": "string",
        "tx_size_in_bytes": 42.0,
        "total_outbound_connections": 42.0
      },
      "transport_address": "string",
      "attributes": {
        "additionalProperty1": "string",
        "additionalProperty2": "string"
      },
      "discovery": {
        "cluster_state_queue": {
          "total": 42.0,
          "pending": 42.0,
          "committed": 42.0
        },
        "published_cluster_states": {
          "full_states": 42.0,
          "incompatible_diffs": 42.0,
          "compatible_diffs": 42.0
        },
        "cluster_state_update": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "serialized_cluster_states": {
          "full_states": {},
          "diffs": {}
        },
        "cluster_applier_stats": {
          "recordings": [
            {}
          ]
        }
      },
      "indexing_pressure": {
        "memory": {
          "limit_in_bytes": 42.0,
          "current": {},
          "total": {}
        }
      },
      "indices": {
        "commit": {
          "generation": 42.0,
          "id": "string",
          "num_docs": 42.0,
          "user_data": {}
        },
        "completion": {
          "size_in_bytes": 42.0,
          "fields": {}
        },
        "docs": {
          "count": 42.0,
          "deleted": 42.0
        },
        "fielddata": {
          "evictions": 42.0,
          "memory_size_in_bytes": 42.0,
          "fields": {}
        },
        "flush": {
          "periodic": 42.0,
          "total": 42.0,
          "total_time": "string"
        },
        "get": {
          "current": 42.0,
          "exists_time": "string",
          "exists_total": 42.0,
          "missing_time": "string",
          "missing_total": 42.0,
          "time": "string",
          "total": 42.0
        },
        "indexing": {
          "index_current": 42.0,
          "delete_current": 42.0,
          "delete_time": "string",
          "delete_total": 42.0,
          "is_throttled": true,
          "noop_update_total": 42.0,
          "throttle_time": "string",
          "index_time": "string",
          "index_total": 42.0,
          "index_failed": 42.0,
          "types": {},
          "write_load": 42.0
        },
        "mappings": {
          "total_count": 42.0,
          "total_estimated_overhead_in_bytes": 42.0
        },
        "merges": {
          "current": 42.0,
          "current_docs": 42.0,
          "current_size": "string",
          "current_size_in_bytes": 42.0,
          "total": 42.0,
          "total_auto_throttle": "string",
          "total_auto_throttle_in_bytes": 42.0,
          "total_docs": 42.0,
          "total_size": "string",
          "total_size_in_bytes": 42.0,
          "total_stopped_time": "string",
          "total_throttled_time": "string",
          "total_time": "string"
        },
        "shard_path": {
          "data_path": "string",
          "is_custom_data_path": true,
          "state_path": "string"
        },
        "query_cache": {
          "cache_count": 42.0,
          "cache_size": 42.0,
          "evictions": 42.0,
          "hit_count": 42.0,
          "memory_size_in_bytes": 42.0,
          "miss_count": 42.0,
          "total_count": 42.0
        },
        "recovery": {
          "current_as_source": 42.0,
          "current_as_target": 42.0,
          "throttle_time": "string"
        },
        "refresh": {
          "external_total": 42.0,
          "listeners": 42.0,
          "total": 42.0,
          "total_time": "string"
        },
        "request_cache": {
          "evictions": 42.0,
          "hit_count": 42.0,
          "memory_size": "string",
          "memory_size_in_bytes": 42.0,
          "miss_count": 42.0
        },
        "retention_leases": {
          "primary_term": 42.0,
          "version": 42.0,
          "leases": [
            {}
          ]
        },
        "routing": {
          "node": "string",
          "primary": true,
          "state": "UNASSIGNED"
        },
        "search": {
          "fetch_current": 42.0,
          "fetch_time": "string",
          "fetch_total": 42.0,
          "open_contexts": 42.0,
          "query_current": 42.0,
          "query_time": "string",
          "query_total": 42.0,
          "scroll_current": 42.0,
          "scroll_time": "string",
          "scroll_total": 42.0,
          "suggest_current": 42.0,
          "suggest_time": "string",
          "suggest_total": 42.0,
          "groups": {}
        },
        "segments": {
          "count": 42.0,
          "doc_values_memory_in_bytes": 42.0,
          "file_sizes": {},
          "fixed_bit_set_memory_in_bytes": 42.0,
          "index_writer_max_memory_in_bytes": 42.0,
          "index_writer_memory_in_bytes": 42.0,
          "max_unsafe_auto_id_timestamp": 42.0,
          "memory_in_bytes": 42.0,
          "norms_memory_in_bytes": 42.0,
          "points_memory_in_bytes": 42.0,
          "stored_fields_memory_in_bytes": 42.0,
          "terms_memory_in_bytes": 42.0,
          "term_vectors_memory_in_bytes": 42.0,
          "version_map_memory_in_bytes": 42.0
        },
        "seq_no": {
          "global_checkpoint": 42.0,
          "local_checkpoint": 42.0,
          "max_seq_no": 42.0
        },
        "store": {
          "size_in_bytes": 42.0,
          "reserved_in_bytes": 42.0,
          "total_data_set_size_in_bytes": 42.0
        },
        "translog": {
          "earliest_last_modified_age": 42.0,
          "operations": 42.0,
          "size": "string",
          "size_in_bytes": 42.0,
          "uncommitted_operations": 42.0,
          "uncommitted_size": "string",
          "uncommitted_size_in_bytes": 42.0
        },
        "warmer": {
          "current": 42.0,
          "total": 42.0,
          "total_time": "string"
        },
        "bulk": {
          "total_operations": 42.0,
          "total_time": "string",
          "total_size_in_bytes": 42.0,
          "avg_time": "string",
          "avg_size_in_bytes": 42.0
        },
        "shards": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "shard_stats": {
          "total_count": 42.0
        },
        "additionalProperty1": {
          "primaries": {},
          "shards": {},
          "total": {},
          "uuid": "string",
          "health": "green",
          "status": "open"
        },
        "additionalProperty2": {
          "primaries": {},
          "shards": {},
          "total": {},
          "uuid": "string",
          "health": "green",
          "status": "open"
        }
      }
    },
    "additionalProperty2": {
      "adaptive_selection": {
        "additionalProperty1": {
          "avg_queue_size": 42.0,
          "avg_response_time": "string",
          "avg_response_time_ns": 42.0,
          "avg_service_time": "string",
          "avg_service_time_ns": 42.0,
          "outgoing_searches": 42.0,
          "rank": "string"
        },
        "additionalProperty2": {
          "avg_queue_size": 42.0,
          "avg_response_time": "string",
          "avg_response_time_ns": 42.0,
          "avg_service_time": "string",
          "avg_service_time_ns": 42.0,
          "outgoing_searches": 42.0,
          "rank": "string"
        }
      },
      "breakers": {
        "additionalProperty1": {
          "estimated_size": "string",
          "estimated_size_in_bytes": 42.0,
          "limit_size": "string",
          "limit_size_in_bytes": 42.0,
          "overhead": 42.0,
          "tripped": 42.0
        },
        "additionalProperty2": {
          "estimated_size": "string",
          "estimated_size_in_bytes": 42.0,
          "limit_size": "string",
          "limit_size_in_bytes": 42.0,
          "overhead": 42.0,
          "tripped": 42.0
        }
      },
      "fs": {
        "data": [
          {}
        ],
        "timestamp": 42.0,
        "total": {
          "available": "string",
          "available_in_bytes": 42.0,
          "free": "string",
          "free_in_bytes": 42.0,
          "total": "string",
          "total_in_bytes": 42.0
        },
        "io_stats": {
          "devices": [
            {}
          ],
          "total": {}
        }
      },
      "host": "string",
      "http": {
        "current_open": 42.0,
        "total_opened": 42.0,
        "clients": [
          {}
        ],
        "routes": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        }
      },
      "ingest": {
        "pipelines": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "total": {
          "count": 42.0,
          "current": 42.0,
          "failed": 42.0
        }
      },
      "ip": "string",
      "jvm": {
        "buffer_pools": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "classes": {
          "current_loaded_count": 42.0,
          "total_loaded_count": 42.0,
          "total_unloaded_count": 42.0
        },
        "gc": {
          "collectors": {}
        },
        "mem": {
          "heap_used_in_bytes": 42.0,
          "heap_used_percent": 42.0,
          "heap_committed_in_bytes": 42.0,
          "heap_max_in_bytes": 42.0,
          "non_heap_used_in_bytes": 42.0,
          "non_heap_committed_in_bytes": 42.0,
          "pools": {}
        },
        "threads": {
          "count": 42.0,
          "peak_count": 42.0
        },
        "timestamp": 42.0,
        "uptime": "string",
        "uptime_in_millis": 42.0
      },
      "name": "string",
      "os": {
        "cpu": {
          "percent": 42.0,
          "sys": "string",
          "total": "string",
          "user": "string",
          "load_average": {}
        },
        "": {},
        "swap": {
          "adjusted_total_in_bytes": 42.0,
          "resident": "string",
          "resident_in_bytes": 42.0,
          "share": "string",
          "share_in_bytes": 42.0,
          "total_virtual": "string",
          "total_virtual_in_bytes": 42.0,
          "total_in_bytes": 42.0,
          "free_in_bytes": 42.0,
          "used_in_bytes": 42.0
        },
        "cgroup": {
          "cpuacct": {},
          "cpu": {},
          "memory": {}
        },
        "timestamp": 42.0
      },
      "process": {
        "cpu": {
          "percent": 42.0,
          "sys": "string",
          "total": "string",
          "user": "string",
          "load_average": {}
        },
        "mem": {
          "adjusted_total_in_bytes": 42.0,
          "resident": "string",
          "resident_in_bytes": 42.0,
          "share": "string",
          "share_in_bytes": 42.0,
          "total_virtual": "string",
          "total_virtual_in_bytes": 42.0,
          "total_in_bytes": 42.0,
          "free_in_bytes": 42.0,
          "used_in_bytes": 42.0
        },
        "open_file_descriptors": 42.0,
        "max_file_descriptors": 42.0,
        "timestamp": 42.0
      },
      "roles": [
        "master"
      ],
      "script": {
        "cache_evictions": 42.0,
        "compilations": 42.0,
        "compilations_history": {
          "additionalProperty1": 42.0,
          "additionalProperty2": 42.0
        },
        "compilation_limit_triggered": 42.0,
        "contexts": [
          {}
        ]
      },
      "script_cache": {},
      "thread_pool": {
        "additionalProperty1": {
          "active": 42.0,
          "completed": 42.0,
          "largest": 42.0,
          "queue": 42.0,
          "rejected": 42.0,
          "threads": 42.0
        },
        "additionalProperty2": {
          "active": 42.0,
          "completed": 42.0,
          "largest": 42.0,
          "queue": 42.0,
          "rejected": 42.0,
          "threads": 42.0
        }
      },
      "timestamp": 42.0,
      "transport": {
        "inbound_handling_time_histogram": [
          {}
        ],
        "outbound_handling_time_histogram": [
          {}
        ],
        "rx_count": 42.0,
        "rx_size": "string",
        "rx_size_in_bytes": 42.0,
        "server_open": 42.0,
        "tx_count": 42.0,
        "tx_size": "string",
        "tx_size_in_bytes": 42.0,
        "total_outbound_connections": 42.0
      },
      "transport_address": "string",
      "attributes": {
        "additionalProperty1": "string",
        "additionalProperty2": "string"
      },
      "discovery": {
        "cluster_state_queue": {
          "total": 42.0,
          "pending": 42.0,
          "committed": 42.0
        },
        "published_cluster_states": {
          "full_states": 42.0,
          "incompatible_diffs": 42.0,
          "compatible_diffs": 42.0
        },
        "cluster_state_update": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "serialized_cluster_states": {
          "full_states": {},
          "diffs": {}
        },
        "cluster_applier_stats": {
          "recordings": [
            {}
          ]
        }
      },
      "indexing_pressure": {
        "memory": {
          "limit_in_bytes": 42.0,
          "current": {},
          "total": {}
        }
      },
      "indices": {
        "commit": {
          "generation": 42.0,
          "id": "string",
          "num_docs": 42.0,
          "user_data": {}
        },
        "completion": {
          "size_in_bytes": 42.0,
          "fields": {}
        },
        "docs": {
          "count": 42.0,
          "deleted": 42.0
        },
        "fielddata": {
          "evictions": 42.0,
          "memory_size_in_bytes": 42.0,
          "fields": {}
        },
        "flush": {
          "periodic": 42.0,
          "total": 42.0,
          "total_time": "string"
        },
        "get": {
          "current": 42.0,
          "exists_time": "string",
          "exists_total": 42.0,
          "missing_time": "string",
          "missing_total": 42.0,
          "time": "string",
          "total": 42.0
        },
        "indexing": {
          "index_current": 42.0,
          "delete_current": 42.0,
          "delete_time": "string",
          "delete_total": 42.0,
          "is_throttled": true,
          "noop_update_total": 42.0,
          "throttle_time": "string",
          "index_time": "string",
          "index_total": 42.0,
          "index_failed": 42.0,
          "types": {},
          "write_load": 42.0
        },
        "mappings": {
          "total_count": 42.0,
          "total_estimated_overhead_in_bytes": 42.0
        },
        "merges": {
          "current": 42.0,
          "current_docs": 42.0,
          "current_size": "string",
          "current_size_in_bytes": 42.0,
          "total": 42.0,
          "total_auto_throttle": "string",
          "total_auto_throttle_in_bytes": 42.0,
          "total_docs": 42.0,
          "total_size": "string",
          "total_size_in_bytes": 42.0,
          "total_stopped_time": "string",
          "total_throttled_time": "string",
          "total_time": "string"
        },
        "shard_path": {
          "data_path": "string",
          "is_custom_data_path": true,
          "state_path": "string"
        },
        "query_cache": {
          "cache_count": 42.0,
          "cache_size": 42.0,
          "evictions": 42.0,
          "hit_count": 42.0,
          "memory_size_in_bytes": 42.0,
          "miss_count": 42.0,
          "total_count": 42.0
        },
        "recovery": {
          "current_as_source": 42.0,
          "current_as_target": 42.0,
          "throttle_time": "string"
        },
        "refresh": {
          "external_total": 42.0,
          "listeners": 42.0,
          "total": 42.0,
          "total_time": "string"
        },
        "request_cache": {
          "evictions": 42.0,
          "hit_count": 42.0,
          "memory_size": "string",
          "memory_size_in_bytes": 42.0,
          "miss_count": 42.0
        },
        "retention_leases": {
          "primary_term": 42.0,
          "version": 42.0,
          "leases": [
            {}
          ]
        },
        "routing": {
          "node": "string",
          "primary": true,
          "state": "UNASSIGNED"
        },
        "search": {
          "fetch_current": 42.0,
          "fetch_time": "string",
          "fetch_total": 42.0,
          "open_contexts": 42.0,
          "query_current": 42.0,
          "query_time": "string",
          "query_total": 42.0,
          "scroll_current": 42.0,
          "scroll_time": "string",
          "scroll_total": 42.0,
          "suggest_current": 42.0,
          "suggest_time": "string",
          "suggest_total": 42.0,
          "groups": {}
        },
        "segments": {
          "count": 42.0,
          "doc_values_memory_in_bytes": 42.0,
          "file_sizes": {},
          "fixed_bit_set_memory_in_bytes": 42.0,
          "index_writer_max_memory_in_bytes": 42.0,
          "index_writer_memory_in_bytes": 42.0,
          "max_unsafe_auto_id_timestamp": 42.0,
          "memory_in_bytes": 42.0,
          "norms_memory_in_bytes": 42.0,
          "points_memory_in_bytes": 42.0,
          "stored_fields_memory_in_bytes": 42.0,
          "terms_memory_in_bytes": 42.0,
          "term_vectors_memory_in_bytes": 42.0,
          "version_map_memory_in_bytes": 42.0
        },
        "seq_no": {
          "global_checkpoint": 42.0,
          "local_checkpoint": 42.0,
          "max_seq_no": 42.0
        },
        "store": {
          "size_in_bytes": 42.0,
          "reserved_in_bytes": 42.0,
          "total_data_set_size_in_bytes": 42.0
        },
        "translog": {
          "earliest_last_modified_age": 42.0,
          "operations": 42.0,
          "size": "string",
          "size_in_bytes": 42.0,
          "uncommitted_operations": 42.0,
          "uncommitted_size": "string",
          "uncommitted_size_in_bytes": 42.0
        },
        "warmer": {
          "current": 42.0,
          "total": 42.0,
          "total_time": "string"
        },
        "bulk": {
          "total_operations": 42.0,
          "total_time": "string",
          "total_size_in_bytes": 42.0,
          "avg_time": "string",
          "avg_size_in_bytes": 42.0
        },
        "shards": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "shard_stats": {
          "total_count": 42.0
        },
        "additionalProperty1": {
          "primaries": {},
          "shards": {},
          "total": {},
          "uuid": "string",
          "health": "green",
          "status": "open"
        },
        "additionalProperty2": {
          "primaries": {},
          "shards": {},
          "total": {},
          "uuid": "string",
          "health": "green",
          "status": "open"
        }
      }
    }
  }
}






































































Create or update a connector Beta

PUT /_connector
application/json

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • result string Required

      Values are created, updated, deleted, not_found, or noop.

    • id string Required
PUT /_connector
curl \
 -X PUT http://api.example.com/_connector \
 -H "Content-Type: application/json" \
 -d '{"description":"string","index_name":"string","is_native":true,"language":"string","name":"string","service_type":"string"}'
Request examples
{
  "description": "string",
  "index_name": "string",
  "is_native": true,
  "language": "string",
  "name": "string",
  "service_type": "string"
}
Response examples (200)
{
  "result": "created",
  "id": "string"
}








Check in a connector sync job Technical preview

PUT /_connector/_sync_job/{connector_sync_job_id}/_check_in

Check in a connector sync job and set the last_seen field to the current time before updating it in the internal index.

To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure. This service runs automatically on Elastic Cloud for Elastic managed connectors.

Path parameters

Responses

  • 200 application/json

    Additional properties are allowed.

PUT /_connector/_sync_job/{connector_sync_job_id}/_check_in
curl \
 -X PUT http://api.example.com/_connector/_sync_job/{connector_sync_job_id}/_check_in
Response examples (200)
{}





















































































Get auto-follow patterns Added in 6.5.0

GET /_ccr/auto_follow/{name}

Get cross-cluster replication auto-follow patterns.

Path parameters

  • name string Required

    Specifies the auto-follow pattern collection that you want to retrieve. If you do not specify a name, the API returns information for all collections.

Responses

GET /_ccr/auto_follow/{name}
curl \
 -X GET http://api.example.com/_ccr/auto_follow/{name}
Response examples (200)
{
  "patterns": [
    {
      "name": "string",
      "pattern": {
        "active": true,
        "remote_cluster": "string",
        "follow_index_pattern": "string",
        "leader_index_patterns": [
          "string"
        ],
        "leader_index_exclusion_patterns": [
          "string"
        ],
        "max_outstanding_read_requests": 42.0
      }
    }
  ]
}








Create a follower Added in 6.5.0

PUT /{index}/_ccr/follow

Create a cross-cluster replication follower index that follows a specific leader index. When the API returns, the follower index exists and cross-cluster replication starts replicating operations from the leader index to the follower index.

Path parameters

  • index string Required

    The name of the follower index

Query parameters

  • wait_for_active_shards number | string

    Sets the number of shard copies that must be active before returning. Defaults to 0. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)

application/json

Body Required

Responses

PUT /{index}/_ccr/follow
curl \
 -X PUT http://api.example.com/{index}/_ccr/follow \
 -H "Content-Type: application/json" \
 -d '{"leader_index":"string","max_outstanding_read_requests":42.0,"max_outstanding_write_requests":42.0,"max_read_request_operation_count":42.0,"max_read_request_size":"string","max_retry_delay":"string","max_write_buffer_count":42.0,"max_write_buffer_size":"string","max_write_request_operation_count":42.0,"max_write_request_size":"string","read_poll_timeout":"string","remote_cluster":"string"}'
Request examples
{
  "leader_index": "string",
  "max_outstanding_read_requests": 42.0,
  "max_outstanding_write_requests": 42.0,
  "max_read_request_operation_count": 42.0,
  "max_read_request_size": "string",
  "max_retry_delay": "string",
  "max_write_buffer_count": 42.0,
  "max_write_buffer_size": "string",
  "max_write_request_operation_count": 42.0,
  "max_write_request_size": "string",
  "read_poll_timeout": "string",
  "remote_cluster": "string"
}
Response examples (200)
{
  "follow_index_created": true,
  "follow_index_shards_acked": true,
  "index_following_started": true
}

























































































Update data streams Added in 7.16.0

POST /_data_stream/_modify

Performs one or more data stream modification actions in a single atomic operation.

application/json

Body Required

  • actions array[object] Required

    Actions to perform.

    Hide actions attributes Show actions attributes object

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • acknowledged boolean Required

      For a successful response, this value is always true. On failure, an exception is returned instead.

POST /_data_stream/_modify
curl \
 -X POST http://api.example.com/_data_stream/_modify \
 -H "Content-Type: application/json" \
 -d '{"actions":[{"add_backing_index":{"data_stream":"string","index":"string"},"remove_backing_index":{"data_stream":"string","index":"string"}}]}'
Request examples
{
  "actions": [
    {
      "add_backing_index": {
        "data_stream": "string",
        "index": "string"
      },
      "remove_backing_index": {
        "data_stream": "string",
        "index": "string"
      }
    }
  ]
}
Response examples (200)
{
  "acknowledged": true
}





























































































































Update a document

POST /{index}/_update/{id}

Update a document by running a script or passing a partial document.

If the Elasticsearch security features are enabled, you must have the index or write index privilege for the target index or index alias.

The script can update, delete, or skip modifying the document. The API also supports passing a partial document, which is merged into the existing document. To fully replace an existing document, use the index API. This operation:

  • Gets the document (collocated with the shard) from the index.
  • Runs the specified script.
  • Indexes the result.

The document must still be reindexed, but using this API removes some network roundtrips and reduces chances of version conflicts between the GET and the index operation.

The _source field must be enabled to use this API. In addition to _source, you can access the following variables through the ctx map: _index, _type, _id, _version, _routing, and _now (the current timestamp).

Path parameters

  • index string Required

    The name of the target index. By default, the index is created automatically if it doesn't exist.

  • id string Required

    A unique identifier for the document to be updated.

Query parameters

  • Only perform the operation if the document has this primary term.

  • Only perform the operation if the document has this sequence number.

  • lang string

    The script language.

  • refresh string

    If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search. If 'wait_for', it waits for a refresh to make this operation visible to search. If 'false', it does nothing with refreshes.

    Values are true, false, or wait_for.

  • If true, the destination must be an index alias.

  • The number of times the operation should be retried when a conflict occurs.

  • routing string

    A custom value used to route operations to a specific shard.

  • timeout string

    The period to wait for the following operations: dynamic mapping updates and waiting for active shards. Elasticsearch waits for at least the timeout period before failing. The actual wait time could be longer, particularly when multiple waits occur.

  • wait_for_active_shards number | string

    The number of copies of each shard that must be active before proceeding with the operation. Set to 'all' or any positive integer up to the total number of shards in the index (number_of_replicas+1). The default value of 1 means it waits for each primary shard to be active.

  • _source boolean | string | array[string]

    If false, source retrieval is turned off. You can also specify a comma-separated list of the fields you want to retrieve.

  • _source_excludes string | array[string]

    The source fields you want to exclude.

  • _source_includes string | array[string]

    The source fields you want to retrieve.

application/json

Body Required

  • If true, the result in the response is set to noop (no operation) when there are no changes to the document.

  • doc object

    A partial update to an existing document. If both doc and script are specified, doc is ignored.

    Additional properties are allowed.

  • If true, use the contents of 'doc' as the value of 'upsert'. NOTE: Using ingest pipelines with doc_as_upsert is not supported.

  • script object

    Additional properties are allowed.

    Hide script attributes Show script attributes object
    • source string

      The script source.

    • id string
    • params object

      Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time.

      Hide params attribute Show params attribute object
      • * object Additional properties

        Additional properties are allowed.

    • lang string

      Any of:

      Values are painless, expression, mustache, or java.

    • options object
      Hide options attribute Show options attribute object
      • * string Additional properties
  • If true, run the script whether or not the document exists.

  • _source boolean | object

    Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.

    One of:
  • upsert object

    If the document does not already exist, the contents of 'upsert' are inserted as a new document. If the document exists, the 'script' is run.

    Additional properties are allowed.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
POST /{index}/_update/{id}
curl \
 -X POST http://api.example.com/{index}/_update/{id} \
 -H "Content-Type: application/json" \
 -d '{"detect_noop":true,"doc":{},"doc_as_upsert":true,"script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"scripted_upsert":true,"":true,"upsert":{}}'
Request examples
{
  "detect_noop": true,
  "doc": {},
  "doc_as_upsert": true,
  "script": {
    "source": "string",
    "id": "string",
    "params": {
      "additionalProperty1": {},
      "additionalProperty2": {}
    },
    "": "painless",
    "options": {
      "additionalProperty1": "string",
      "additionalProperty2": "string"
    }
  },
  "scripted_upsert": true,
  "": true,
  "upsert": {}
}
Response examples (200)
{
  "_id": "string",
  "_index": "string",
  "_primary_term": 42.0,
  "result": "created",
  "_seq_no": 42.0,
  "_shards": {
    "failed": 42.0,
    "successful": 42.0,
    "total": 42.0,
    "failures": [
      {
        "index": "string",
        "node": "string",
        "reason": {
          "type": "string",
          "reason": "string",
          "stack_trace": "string",
          "caused_by": {},
          "root_cause": [
            {}
          ],
          "suppressed": [
            {}
          ]
        },
        "shard": 42.0,
        "status": "string"
      }
    ],
    "skipped": 42.0
  },
  "_version": 42.0,
  "forced_refresh": true,
  "get": {
    "fields": {
      "additionalProperty1": {},
      "additionalProperty2": {}
    },
    "found": true,
    "_seq_no": 42.0,
    "_primary_term": 42.0,
    "_routing": "string",
    "_source": {}
  }
}






















































ES|QL

The Elasticsearch Query Language (ES|QL) provides a powerful way to filter, transform, and analyze data stored in Elasticsearch, and in the future in other runtimes.

Run an async ES|QL query Added in 8.13.0

POST /_query/async

Asynchronously run an ES|QL (Elasticsearch query language) query, monitor its progress, and retrieve results when they become available.

The API accepts the same parameters and request body as the synchronous query API, along with additional async related properties.

Query parameters

  • The character to use between values within a CSV row. It is valid only for the CSV format.

  • Indicates whether columns that are entirely null will be removed from the columns and values portion of the results. If true, the response will include an extra section under the name all_columns which has the name of all the columns.

  • format string

    A short version of the Accept header, for example json or yaml.

    Values are csv, json, tsv, txt, yaml, cbor, smile, or arrow.

  • The period for which the query and its results are stored in the cluster. The default period is five days. When this period expires, the query and its results are deleted, even if the query is still ongoing. If the keep_on_completion parameter is false, Elasticsearch only stores async queries that do not complete within the period set by the wait_for_completion_timeout parameter, regardless of this value.

  • Indicates whether the query and its results are stored in the cluster. If false, the query and its results are stored in the cluster only if the request does not complete during the period set by the wait_for_completion_timeout parameter.

  • The period to wait for the request to finish. By default, the request waits for 1 second for the query results. If the query completes during this period, results are returned Otherwise, a query ID is returned that can later be used to retrieve the results.

application/json

Body Required

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • columns object

      Additional properties are allowed.

    • id string

      A query identifier that is provided only when one of the following conditions is met:

      • A query request does not return complete results during the period specified in the wait_for_completion_timeout parameter.
      • The keep_on_completion parameter value is true.

      You can use this ID with the GET /_query/async/<id> API to get the current status and available results for the query.

    • is_running boolean Required

      Indicates whether the query is still running. If the value is false, the async query has finished and the results are returned.

POST /_query/async
curl \
 -X POST http://api.example.com/_query/async \
 -H "Content-Type: application/json" \
 -d '"{\n  \"query\": \"\"\"\n    FROM library\n    | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n    | STATS MAX(page_count) BY year\n    | SORT year\n    | LIMIT 5\n  \"\"\",\n  \"wait_for_completion_timeout\": \"2s\"\n}"'
Request example
{
  "query": """
    FROM library
    | EVAL year = DATE_TRUNC(1 YEARS, release_date)
    | STATS MAX(page_count) BY year
    | SORT year
    | LIMIT 5
  """,
  "wait_for_completion_timeout": "2s"
}
Response examples (200)
{
  "columns": {},
  "id": "string",
  "is_running": true
}
















































































Get component templates Added in 7.8.0

GET /_component_template

Get information about component templates.

Query parameters

  • If true, returns settings in flat format.

  • Return all default configurations for the component template (default: false)

  • local boolean

    If true, the request retrieves information from the local node only. If false, information is retrieved from the master node.

  • Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • component_templates array[object] Required
      Hide component_templates attributes Show component_templates attributes object
      • name string Required
      • component_template object Required

        Additional properties are allowed.

        Hide component_template attributes Show component_template attributes object
        • template object Required

          Additional properties are allowed.

          Hide template attributes Show template attributes object
        • version number
        • _meta object
          Hide _meta attribute Show _meta attribute object
          • * object Additional properties

            Additional properties are allowed.

GET /_component_template
curl \
 -X GET http://api.example.com/_component_template
Response examples (200)
{
  "component_templates": [
    {
      "name": "string",
      "component_template": {
        "template": {
          "_meta": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          },
          "version": 42.0,
          "settings": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          },
          "mappings": {
            "all_field": {},
            "date_detection": true,
            "dynamic": "strict",
            "dynamic_date_formats": [
              "string"
            ],
            "dynamic_templates": [
              {}
            ],
            "_field_names": {},
            "index_field": {},
            "_meta": {},
            "numeric_detection": true,
            "properties": {},
            "_routing": {},
            "_size": {},
            "_source": {},
            "runtime": {},
            "enabled": true,
            "subobjects": true,
            "_data_stream_timestamp": {}
          },
          "aliases": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          },
          "lifecycle": {
            "data_retention": "string",
            "downsampling": {},
            "rollover": {}
          }
        },
        "version": 42.0,
        "_meta": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        }
      }
    }
  ]
}








Get the dangling indices Added in 7.9.0

GET /_dangling

If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling. For example, this can happen if you delete more than cluster.indices.tombstones.size indices while an Elasticsearch node is offline.

Use this API to list dangling indices, which you can then import or delete.

Responses

GET /_dangling
curl \
 -X GET http://api.example.com/_dangling
Response examples (200)
{
  "dangling_indices": [
    {
      "index_name": "string",
      "index_uuid": "string",
      "": "string"
    }
  ]
}




































































Delete an alias

DELETE /{index}/_alias/{name}

Removes a data stream or index from an alias.

Path parameters

  • index string | array[string] Required

    Comma-separated list of data streams or indices used to limit the request. Supports wildcards (*).

  • name string | array[string] Required

    Comma-separated list of aliases to remove. Supports wildcards (*). To remove all aliases, use * or _all.

Query parameters

  • Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout string

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • acknowledged boolean Required

      For a successful response, this value is always true. On failure, an exception is returned instead.

DELETE /{index}/_alias/{name}
curl \
 -X DELETE http://api.example.com/{index}/_alias/{name}
Response examples (200)
{
  "acknowledged": true
}












































































































































Update index settings

PUT /_settings

Changes dynamic index settings in real time. For data streams, index setting changes are applied to all backing indices by default.

To revert a setting to the default value, use a null value. The list of per-index settings that can be updated dynamically on live indices can be found in index module documentation. To preserve existing settings from being updated, set the preserve_existing parameter to true.

NOTE: You can only define new analyzers on closed indices. To add an analyzer, you must close the index, define the analyzer, and reopen the index. You cannot close the write index of a data stream. To update the analyzer for a data stream's write index and future backing indices, update the analyzer in the index template used by the stream. Then roll over the data stream to apply the new analyzer to the stream's write index and future backing indices. This affects searches and any new data added to the stream after the rollover. However, it does not affect the data stream's backing indices or their existing data. To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.

Query parameters

  • 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. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

  • expand_wildcards string | 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.

  • If true, returns settings in flat format.

  • If true, returns settings in flat format.

  • Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • If true, existing index settings remain unchanged.

  • timeout string

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

application/json

Body Required

  • index object Additional properties

    Additional properties are allowed.

  • mode string
  • Additional properties are allowed.

    Hide soft_deletes attributes Show soft_deletes attributes object
    • enabled boolean

      Indicates whether soft deletes are enabled on the index.

    • Additional properties are allowed.

      Hide retention_lease attribute Show retention_lease attribute object
      • period string Required

        A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

  • sort object

    Additional properties are allowed.

    Hide sort attributes Show sort attributes object
  • Values are true, false, or checksum.

  • codec string
  • routing_partition_size number | string

    Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior is used to capture this behavior while keeping the semantics of the field type.

    Depending on the target language, code generators can keep the union or remove it and leniently parse strings to the target type.

  • merge object

    Additional properties are allowed.

    Hide merge attribute Show merge attribute object
  • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

  • blocks object

    Additional properties are allowed.

    Hide blocks attributes Show blocks attributes object
  • analyze object

    Additional properties are allowed.

    Hide analyze attribute Show analyze attribute object
  • Additional properties are allowed.

    Hide highlight attribute Show highlight attribute object
  • routing object

    Additional properties are allowed.

    Hide routing attributes Show routing attributes object
  • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

  • Additional properties are allowed.

    Hide lifecycle attributes Show lifecycle attributes object
    • name string
    • indexing_complete boolean | string

      Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior is used to capture this behavior while keeping the semantics of the field type.

      Depending on the target language, code generators can keep the union or remove it and leniently parse strings to the target type.

    • If specified, this is the timestamp used to calculate the index age for its phase transitions. Use this setting if you create a new index that contains old data and want to use the original creation date to calculate the index age. Specified as a Unix epoch value in milliseconds.

    • Set to true to parse the origination date from the index name. This origination date is used to calculate the index age for its phase transitions. The index name must match the pattern .*-{date_format}-\d+, where the date_format is yyyy.MM.dd and the trailing digits are optional. An index that was rolled over would normally match the full format, for example logs-2016.10.31-000002). If the index name doesn’t match the pattern, index creation fails.

    • step object

      Additional properties are allowed.

      Hide step attribute Show step attribute object
      • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

    • The index alias to update when the index rolls over. Specify when using a policy that contains a rollover action. When the index rolls over, the alias is updated to reflect that the index is no longer the write index. For more information about rolling indices, see Rollover.

  • creation_date number | string

    Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior is used to capture this behavior while keeping the semantics of the field type.

    Depending on the target language, code generators can keep the union or remove it and leniently parse strings to the target type.

  • creation_date_string string | number

    A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

  • uuid string
  • version object

    Additional properties are allowed.

    Hide version attributes Show version attributes object
  • translog object

    Additional properties are allowed.

    Hide translog attributes Show translog attributes object
  • Additional properties are allowed.

    Hide query_string attribute Show query_string attribute object
  • analysis object

    Additional properties are allowed.

    Hide analysis attributes Show analysis attributes object
  • settings object Additional properties

    Additional properties are allowed.

  • Additional properties are allowed.

    Hide time_series attributes Show time_series attributes object
  • queries object

    Additional properties are allowed.

    Hide queries attribute Show queries attribute object
    • cache object

      Additional properties are allowed.

      Hide cache attribute Show cache attribute object
  • Configure custom similarity settings to customize how search results are scored.

  • mapping object

    Additional properties are allowed.

    Hide mapping attributes Show mapping attributes object
    • coerce boolean
    • Additional properties are allowed.

      Hide total_fields attributes Show total_fields attributes object
      • limit number | string

        The maximum number of fields in an index. Field and object mappings, as well as field aliases count towards this limit. The limit is in place to prevent mappings and searches from becoming too large. Higher values can lead to performance degradations and memory issues, especially in clusters with a high load or few resources.

      • ignore_dynamic_beyond_limit boolean | string

        This setting determines what happens when a dynamically mapped field would exceed the total fields limit. When set to false (the default), the index request of the document that tries to add a dynamic field to the mapping will fail with the message Limit of total fields [X] has been exceeded. When set to true, the index request will not fail. Instead, fields that would exceed the limit are not added to the mapping, similar to dynamic: false. The fields that were not added to the mapping will be added to the _ignored field.

    • depth object

      Additional properties are allowed.

      Hide depth attribute Show depth attribute object
      • limit number

        The maximum depth for a field, which is measured as the number of inner objects. For instance, if all fields are defined at the root object level, then the depth is 1. If there is one object mapping, then the depth is 2, etc.

    • Additional properties are allowed.

      Hide nested_fields attribute Show nested_fields attribute object
      • limit number

        The maximum number of distinct nested mappings in an index. The nested type should only be used in special cases, when arrays of objects need to be queried independently of each other. To safeguard against poorly designed mappings, this setting limits the number of unique nested types per index.

    • Additional properties are allowed.

      Hide nested_objects attribute Show nested_objects attribute object
      • limit number

        The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps to prevent out of memory errors when a document contains too many nested objects.

    • Additional properties are allowed.

      Hide field_name_length attribute Show field_name_length attribute object
      • limit number

        Setting for the maximum length of a field name. This setting isn’t really something that addresses mappings explosion but might still be useful if you want to limit the field length. It usually shouldn’t be necessary to set this setting. The default is okay unless a user starts to add a huge number of fields with really long names. Default is Long.MAX_VALUE (no limit).

    • Additional properties are allowed.

      Hide dimension_fields attribute Show dimension_fields attribute object
      • limit number

        [preview] This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.

  • Additional properties are allowed.

    Hide indexing.slowlog attributes Show indexing.slowlog attributes object
    • level string
    • source number
    • reformat boolean
    • Additional properties are allowed.

      Hide threshold attribute Show threshold attribute object
      • index object

        Additional properties are allowed.

        Hide index attributes Show index attributes object
        • warn string

          A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

        • info string

          A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

        • debug string

          A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

        • trace string

          A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

  • Additional properties are allowed.

    Hide indexing_pressure attribute Show indexing_pressure attribute object
    • memory object Required

      Additional properties are allowed.

      Hide memory attribute Show memory attribute object
      • limit number

        Number of outstanding bytes that may be consumed by indexing requests. When this limit is reached or exceeded, the node will reject new coordinating and primary operations. When replica operations consume 1.5x this limit, the node will reject new replica operations. Defaults to 10% of the heap.

  • store object

    Additional properties are allowed.

    Hide store attributes Show store attributes object
    • type string Required

    • allow_mmap boolean

      You can restrict the use of the mmapfs and the related hybridfs store type via the setting node.store.allow_mmap. This is a boolean setting indicating whether or not memory-mapping is allowed. The default is to allow it. This setting is useful, for example, if you are in an environment where you can not control the ability to create a lot of memory maps so you need disable the ability to use memory-mapping.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • acknowledged boolean Required

      For a successful response, this value is always true. On failure, an exception is returned instead.

PUT /_settings
curl \
 -X PUT http://api.example.com/_settings \
 -H "Content-Type: application/json" \
 -d '"{\n  \"index\" : {\n    \"number_of_replicas\" : 2\n  }\n}"'
Request example
{
  "index" : {
    "number_of_replicas" : 2
  }
}
Response examples (200)
{
  "acknowledged": true
}




























































Resolve indices Added in 7.9.0

GET /_resolve/index/{name}

Resolve the names and/or index patterns for indices, aliases, and data streams. Multiple patterns and remote clusters are supported.

Path parameters

  • name string | array[string] Required

    Comma-separated name(s) or index pattern(s) of the indices, aliases, and data streams to resolve. Resources on remote clusters can be specified using the <cluster>:<name> syntax.

Query parameters

  • expand_wildcards string | 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.

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

  • 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. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
GET /_resolve/index/{name}
curl \
 -X GET http://api.example.com/_resolve/index/{name}
Response examples (200)
A successful response from `GET /_resolve/index/f*,remoteCluster1:bar*?expand_wildcards=all`.
{
  "indices": [
    {
      "name": "foo_closed",
      "attributes": [
        "closed"
      ]
    },
    {
      "name": "freeze-index",
      "aliases": [
        "f-alias"
      ],
      "attributes": [
        "open"
      ]
    },
    {
      "name": "remoteCluster1:bar-01",
      "attributes": [
        "open"
      ]
    }
  ],
  "aliases": [
    {
      "name": "f-alias",
      "indices": [
        "freeze-index",
        "my-index-000001"
      ]
    }
  ],
  "data_streams": [
    {
      "name": "foo",
      "backing_indices": [
        ".ds-foo-2099.03.07-000001"
      ],
      "timestamp_field": "@timestamp"
    }
  ]
}












































Split an index Added in 6.1.0

PUT /{index}/_split/{target}

Split an index into a new index with more primary shards.

  • Before you can split an index:

  • The index must be read-only.

  • The cluster health status must be green.

You can do make an index read-only with the following request using the add index block API:

PUT /my_source_index/_block/write

The current write index on a data stream cannot be split. In order to split the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be split.

The number of times the index can be split (and the number of shards that each original shard can be split into) is determined by the index.number_of_routing_shards setting. The number of routing shards specifies the hashing space that is used internally to distribute documents across shards with consistent hashing. For instance, a 5 shard index with number_of_routing_shards set to 30 (5 x 2 x 3) could be split by a factor of 2 or 3.

A split operation:

  • Creates a new target index with the same definition as the source index, but with a larger number of primary shards.
  • Hard-links segments from the source index into the target index. If the file system doesn't support hard-linking, all segments are copied into the new index, which is a much more time consuming process.
  • Hashes all documents again, after low level files are created, to delete documents that belong to a different shard.
  • Recovers the target index as though it were a closed index which had just been re-opened.

IMPORTANT: Indices can only be split if they satisfy the following requirements:

  • The target index must not exist.
  • The source index must have fewer primary shards than the target index.
  • The number of primary shards in the target index must be a multiple of the number of primary shards in the source index.
  • The node handling the split process must have sufficient free disk space to accommodate a second copy of the existing index.

Path parameters

  • index string Required

    Name of the source index to split.

  • target string Required

    Name of the target index to create.

Query parameters

  • Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout string

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • wait_for_active_shards number | string

    The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1).

application/json

Body

  • aliases object

    Aliases for the resulting index.

    Hide aliases attribute Show aliases attribute object
  • settings object

    Configuration options for the target index.

    Hide settings attribute Show settings attribute object
    • * object Additional properties

      Additional properties are allowed.

Responses

PUT /{index}/_split/{target}
curl \
 -X PUT http://api.example.com/{index}/_split/{target} \
 -H "Content-Type: application/json" \
 -d '"{\n  \"settings\": {\n    \"index.number_of_shards\": 2\n  }\n}"'
Request example
Split an existing index into a new index with more primary shards.
{
  "settings": {
    "index.number_of_shards": 2
  }
}
Response examples (200)
{
  "acknowledged": true,
  "shards_acknowledged": true,
  "index": "string"
}




Get index statistics Added in 1.3.0

GET /_stats

For data streams, the API retrieves statistics for the stream's backing indices.

By default, the returned statistics are index-level with primaries and total aggregations. primaries are the values for only the primary shards. total are the accumulated values for both primary and replica shards.

To get shard-level statistics, set the level parameter to shards.

NOTE: When moving to another node, the shard-level statistics for a shard are cleared. Although the shard is no longer part of the node, that node retains any node-level statistics to which the shard contributed.

Query parameters

  • completion_fields string | array[string]

    Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics.

  • expand_wildcards string | 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.

  • fielddata_fields string | array[string]

    Comma-separated list or wildcard expressions of fields to include in fielddata statistics.

  • fields string | array[string]

    Comma-separated list or wildcard expressions of fields to include in the statistics.

  • If true, statistics are not collected from closed indices.

  • groups string | array[string]

    Comma-separated list of search groups to include in the search statistics.

  • If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).

  • If true, the response includes information from segments that are not loaded into memory.

  • level string

    Indicates whether statistics are aggregated at the cluster, index, or shard level.

    Values are cluster, indices, or shards.

Responses

GET /_stats
curl \
 -X GET http://api.example.com/_stats
Response examples (200)
{
  "indices": {
    "additionalProperty1": {
      "primaries": {
        "completion": {
          "size_in_bytes": 42.0,
          "": 42.0,
          "fields": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          }
        },
        "docs": {
          "count": 42.0,
          "deleted": 42.0
        },
        "fielddata": {
          "evictions": 42.0,
          "": 42.0,
          "memory_size_in_bytes": 42.0,
          "fields": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          }
        },
        "flush": {
          "periodic": 42.0,
          "total": 42.0,
          "total_time": "string",
          "": 42.0
        },
        "get": {
          "current": 42.0,
          "exists_time": "string",
          "": 42.0,
          "exists_total": 42.0,
          "missing_time": "string",
          "missing_total": 42.0,
          "time": "string",
          "total": 42.0
        },
        "indexing": {
          "index_current": 42.0,
          "delete_current": 42.0,
          "delete_time": "string",
          "": 42.0,
          "delete_total": 42.0,
          "is_throttled": true,
          "noop_update_total": 42.0,
          "throttle_time": "string",
          "index_time": "string",
          "index_total": 42.0,
          "index_failed": 42.0,
          "types": {
            "*": {}
          },
          "write_load": 42.0
        },
        "additionalProperty1": {},
        "additionalProperty2": {},
        "merges": {
          "current": 42.0,
          "current_docs": 42.0,
          "current_size": "string",
          "current_size_in_bytes": 42.0,
          "total": 42.0,
          "total_auto_throttle": "string",
          "total_auto_throttle_in_bytes": 42.0,
          "total_docs": 42.0,
          "total_size": "string",
          "total_size_in_bytes": 42.0,
          "total_stopped_time": "string",
          "": 42.0,
          "total_throttled_time": "string",
          "total_time": "string"
        },
        "query_cache": {
          "cache_count": 42.0,
          "cache_size": 42.0,
          "evictions": 42.0,
          "hit_count": 42.0,
          "": 42.0,
          "memory_size_in_bytes": 42.0,
          "miss_count": 42.0,
          "total_count": 42.0
        },
        "recovery": {
          "current_as_source": 42.0,
          "current_as_target": 42.0,
          "throttle_time": "string",
          "": 42.0
        },
        "refresh": {
          "external_total": 42.0,
          "": 42.0,
          "listeners": 42.0,
          "total": 42.0,
          "total_time": "string"
        },
        "request_cache": {
          "evictions": 42.0,
          "hit_count": 42.0,
          "memory_size": "string",
          "memory_size_in_bytes": 42.0,
          "miss_count": 42.0
        },
        "search": {
          "fetch_current": 42.0,
          "fetch_time": "string",
          "": 42.0,
          "fetch_total": 42.0,
          "open_contexts": 42.0,
          "query_current": 42.0,
          "query_time": "string",
          "query_total": 42.0,
          "scroll_current": 42.0,
          "scroll_time": "string",
          "scroll_total": 42.0,
          "suggest_current": 42.0,
          "suggest_time": "string",
          "suggest_total": 42.0,
          "groups": {
            "*": {}
          }
        },
        "segments": {
          "count": 42.0,
          "": 42.0,
          "doc_values_memory_in_bytes": 42.0,
          "file_sizes": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          },
          "fixed_bit_set_memory_in_bytes": 42.0,
          "index_writer_max_memory_in_bytes": 42.0,
          "index_writer_memory_in_bytes": 42.0,
          "max_unsafe_auto_id_timestamp": 42.0,
          "memory_in_bytes": 42.0,
          "norms_memory_in_bytes": 42.0,
          "points_memory_in_bytes": 42.0,
          "stored_fields_memory_in_bytes": 42.0,
          "terms_memory_in_bytes": 42.0,
          "term_vectors_memory_in_bytes": 42.0,
          "version_map_memory_in_bytes": 42.0
        },
        "store": {
          "": 42.0,
          "size_in_bytes": 42.0,
          "reserved_in_bytes": 42.0,
          "total_data_set_size_in_bytes": 42.0
        },
        "translog": {
          "earliest_last_modified_age": 42.0,
          "operations": 42.0,
          "size": "string",
          "size_in_bytes": 42.0,
          "uncommitted_operations": 42.0,
          "uncommitted_size": "string",
          "uncommitted_size_in_bytes": 42.0
        },
        "warmer": {
          "current": 42.0,
          "total": 42.0,
          "total_time": "string",
          "": 42.0
        },
        "bulk": {
          "total_operations": 42.0,
          "total_time": "string",
          "": 42.0,
          "total_size_in_bytes": 42.0,
          "avg_time": "string",
          "avg_size_in_bytes": 42.0
        },
        "shard_stats": {
          "total_count": 42.0
        }
      },
      "shards": {
        "additionalProperty1": [
          {
            "commit": {},
            "completion": {},
            "docs": {},
            "fielddata": {},
            "flush": {},
            "get": {},
            "indexing": {},
            "mappings": {},
            "merges": {},
            "shard_path": {},
            "query_cache": {},
            "recovery": {},
            "refresh": {},
            "request_cache": {},
            "retention_leases": {},
            "routing": {},
            "search": {},
            "segments": {},
            "seq_no": {},
            "store": {},
            "translog": {},
            "warmer": {},
            "bulk": {},
            "shards": {},
            "shard_stats": {},
            "additionalProperty1": {},
            "additionalProperty2": {}
          }
        ],
        "additionalProperty2": [
          {
            "commit": {},
            "completion": {},
            "docs": {},
            "fielddata": {},
            "flush": {},
            "get": {},
            "indexing": {},
            "mappings": {},
            "merges": {},
            "shard_path": {},
            "query_cache": {},
            "recovery": {},
            "refresh": {},
            "request_cache": {},
            "retention_leases": {},
            "routing": {},
            "search": {},
            "segments": {},
            "seq_no": {},
            "store": {},
            "translog": {},
            "warmer": {},
            "bulk": {},
            "shards": {},
            "shard_stats": {},
            "additionalProperty1": {},
            "additionalProperty2": {}
          }
        ]
      },
      "total": {
        "completion": {
          "size_in_bytes": 42.0,
          "": 42.0,
          "fields": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          }
        },
        "docs": {
          "count": 42.0,
          "deleted": 42.0
        },
        "fielddata": {
          "evictions": 42.0,
          "": 42.0,
          "memory_size_in_bytes": 42.0,
          "fields": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          }
        },
        "flush": {
          "periodic": 42.0,
          "total": 42.0,
          "total_time": "string",
          "": 42.0
        },
        "get": {
          "current": 42.0,
          "exists_time": "string",
          "": 42.0,
          "exists_total": 42.0,
          "missing_time": "string",
          "missing_total": 42.0,
          "time": "string",
          "total": 42.0
        },
        "indexing": {
          "index_current": 42.0,
          "delete_current": 42.0,
          "delete_time": "string",
          "": 42.0,
          "delete_total": 42.0,
          "is_throttled": true,
          "noop_update_total": 42.0,
          "throttle_time": "string",
          "index_time": "string",
          "index_total": 42.0,
          "index_failed": 42.0,
          "types": {
            "*": {}
          },
          "write_load": 42.0
        },
        "additionalProperty1": {},
        "additionalProperty2": {},
        "merges": {
          "current": 42.0,
          "current_docs": 42.0,
          "current_size": "string",
          "current_size_in_bytes": 42.0,
          "total": 42.0,
          "total_auto_throttle": "string",
          "total_auto_throttle_in_bytes": 42.0,
          "total_docs": 42.0,
          "total_size": "string",
          "total_size_in_bytes": 42.0,
          "total_stopped_time": "string",
          "": 42.0,
          "total_throttled_time": "string",
          "total_time": "string"
        },
        "query_cache": {
          "cache_count": 42.0,
          "cache_size": 42.0,
          "evictions": 42.0,
          "hit_count": 42.0,
          "": 42.0,
          "memory_size_in_bytes": 42.0,
          "miss_count": 42.0,
          "total_count": 42.0
        },
        "recovery": {
          "current_as_source": 42.0,
          "current_as_target": 42.0,
          "throttle_time": "string",
          "": 42.0
        },
        "refresh": {
          "external_total": 42.0,
          "": 42.0,
          "listeners": 42.0,
          "total": 42.0,
          "total_time": "string"
        },
        "request_cache": {
          "evictions": 42.0,
          "hit_count": 42.0,
          "memory_size": "string",
          "memory_size_in_bytes": 42.0,
          "miss_count": 42.0
        },
        "search": {
          "fetch_current": 42.0,
          "fetch_time": "string",
          "": 42.0,
          "fetch_total": 42.0,
          "open_contexts": 42.0,
          "query_current": 42.0,
          "query_time": "string",
          "query_total": 42.0,
          "scroll_current": 42.0,
          "scroll_time": "string",
          "scroll_total": 42.0,
          "suggest_current": 42.0,
          "suggest_time": "string",
          "suggest_total": 42.0,
          "groups": {
            "*": {}
          }
        },
        "segments": {
          "count": 42.0,
          "": 42.0,
          "doc_values_memory_in_bytes": 42.0,
          "file_sizes": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          },
          "fixed_bit_set_memory_in_bytes": 42.0,
          "index_writer_max_memory_in_bytes": 42.0,
          "index_writer_memory_in_bytes": 42.0,
          "max_unsafe_auto_id_timestamp": 42.0,
          "memory_in_bytes": 42.0,
          "norms_memory_in_bytes": 42.0,
          "points_memory_in_bytes": 42.0,
          "stored_fields_memory_in_bytes": 42.0,
          "terms_memory_in_bytes": 42.0,
          "term_vectors_memory_in_bytes": 42.0,
          "version_map_memory_in_bytes": 42.0
        },
        "store": {
          "": 42.0,
          "size_in_bytes": 42.0,
          "reserved_in_bytes": 42.0,
          "total_data_set_size_in_bytes": 42.0
        },
        "translog": {
          "earliest_last_modified_age": 42.0,
          "operations": 42.0,
          "size": "string",
          "size_in_bytes": 42.0,
          "uncommitted_operations": 42.0,
          "uncommitted_size": "string",
          "uncommitted_size_in_bytes": 42.0
        },
        "warmer": {
          "current": 42.0,
          "total": 42.0,
          "total_time": "string",
          "": 42.0
        },
        "bulk": {
          "total_operations": 42.0,
          "total_time": "string",
          "": 42.0,
          "total_size_in_bytes": 42.0,
          "avg_time": "string",
          "avg_size_in_bytes": 42.0
        },
        "shard_stats": {
          "total_count": 42.0
        }
      },
      "uuid": "string",
      "health": "green",
      "status": "open"
    },
    "additionalProperty2": {
      "primaries": {
        "completion": {
          "size_in_bytes": 42.0,
          "": 42.0,
          "fields": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          }
        },
        "docs": {
          "count": 42.0,
          "deleted": 42.0
        },
        "fielddata": {
          "evictions": 42.0,
          "": 42.0,
          "memory_size_in_bytes": 42.0,
          "fields": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          }
        },
        "flush": {
          "periodic": 42.0,
          "total": 42.0,
          "total_time": "string",
          "": 42.0
        },
        "get": {
          "current": 42.0,
          "exists_time": "string",
          "": 42.0,
          "exists_total": 42.0,
          "missing_time": "string",
          "missing_total": 42.0,
          "time": "string",
          "total": 42.0
        },
        "indexing": {
          "index_current": 42.0,
          "delete_current": 42.0,
          "delete_time": "string",
          "": 42.0,
          "delete_total": 42.0,
          "is_throttled": true,
          "noop_update_total": 42.0,
          "throttle_time": "string",
          "index_time": "string",
          "index_total": 42.0,
          "index_failed": 42.0,
          "types": {
            "*": {}
          },
          "write_load": 42.0
        },
        "additionalProperty1": {},
        "additionalProperty2": {},
        "merges": {
          "current": 42.0,
          "current_docs": 42.0,
          "current_size": "string",
          "current_size_in_bytes": 42.0,
          "total": 42.0,
          "total_auto_throttle": "string",
          "total_auto_throttle_in_bytes": 42.0,
          "total_docs": 42.0,
          "total_size": "string",
          "total_size_in_bytes": 42.0,
          "total_stopped_time": "string",
          "": 42.0,
          "total_throttled_time": "string",
          "total_time": "string"
        },
        "query_cache": {
          "cache_count": 42.0,
          "cache_size": 42.0,
          "evictions": 42.0,
          "hit_count": 42.0,
          "": 42.0,
          "memory_size_in_bytes": 42.0,
          "miss_count": 42.0,
          "total_count": 42.0
        },
        "recovery": {
          "current_as_source": 42.0,
          "current_as_target": 42.0,
          "throttle_time": "string",
          "": 42.0
        },
        "refresh": {
          "external_total": 42.0,
          "": 42.0,
          "listeners": 42.0,
          "total": 42.0,
          "total_time": "string"
        },
        "request_cache": {
          "evictions": 42.0,
          "hit_count": 42.0,
          "memory_size": "string",
          "memory_size_in_bytes": 42.0,
          "miss_count": 42.0
        },
        "search": {
          "fetch_current": 42.0,
          "fetch_time": "string",
          "": 42.0,
          "fetch_total": 42.0,
          "open_contexts": 42.0,
          "query_current": 42.0,
          "query_time": "string",
          "query_total": 42.0,
          "scroll_current": 42.0,
          "scroll_time": "string",
          "scroll_total": 42.0,
          "suggest_current": 42.0,
          "suggest_time": "string",
          "suggest_total": 42.0,
          "groups": {
            "*": {}
          }
        },
        "segments": {
          "count": 42.0,
          "": 42.0,
          "doc_values_memory_in_bytes": 42.0,
          "file_sizes": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          },
          "fixed_bit_set_memory_in_bytes": 42.0,
          "index_writer_max_memory_in_bytes": 42.0,
          "index_writer_memory_in_bytes": 42.0,
          "max_unsafe_auto_id_timestamp": 42.0,
          "memory_in_bytes": 42.0,
          "norms_memory_in_bytes": 42.0,
          "points_memory_in_bytes": 42.0,
          "stored_fields_memory_in_bytes": 42.0,
          "terms_memory_in_bytes": 42.0,
          "term_vectors_memory_in_bytes": 42.0,
          "version_map_memory_in_bytes": 42.0
        },
        "store": {
          "": 42.0,
          "size_in_bytes": 42.0,
          "reserved_in_bytes": 42.0,
          "total_data_set_size_in_bytes": 42.0
        },
        "translog": {
          "earliest_last_modified_age": 42.0,
          "operations": 42.0,
          "size": "string",
          "size_in_bytes": 42.0,
          "uncommitted_operations": 42.0,
          "uncommitted_size": "string",
          "uncommitted_size_in_bytes": 42.0
        },
        "warmer": {
          "current": 42.0,
          "total": 42.0,
          "total_time": "string",
          "": 42.0
        },
        "bulk": {
          "total_operations": 42.0,
          "total_time": "string",
          "": 42.0,
          "total_size_in_bytes": 42.0,
          "avg_time": "string",
          "avg_size_in_bytes": 42.0
        },
        "shard_stats": {
          "total_count": 42.0
        }
      },
      "shards": {
        "additionalProperty1": [
          {
            "commit": {},
            "completion": {},
            "docs": {},
            "fielddata": {},
            "flush": {},
            "get": {},
            "indexing": {},
            "mappings": {},
            "merges": {},
            "shard_path": {},
            "query_cache": {},
            "recovery": {},
            "refresh": {},
            "request_cache": {},
            "retention_leases": {},
            "routing": {},
            "search": {},
            "segments": {},
            "seq_no": {},
            "store": {},
            "translog": {},
            "warmer": {},
            "bulk": {},
            "shards": {},
            "shard_stats": {},
            "additionalProperty1": {},
            "additionalProperty2": {}
          }
        ],
        "additionalProperty2": [
          {
            "commit": {},
            "completion": {},
            "docs": {},
            "fielddata": {},
            "flush": {},
            "get": {},
            "indexing": {},
            "mappings": {},
            "merges": {},
            "shard_path": {},
            "query_cache": {},
            "recovery": {},
            "refresh": {},
            "request_cache": {},
            "retention_leases": {},
            "routing": {},
            "search": {},
            "segments": {},
            "seq_no": {},
            "store": {},
            "translog": {},
            "warmer": {},
            "bulk": {},
            "shards": {},
            "shard_stats": {},
            "additionalProperty1": {},
            "additionalProperty2": {}
          }
        ]
      },
      "total": {
        "completion": {
          "size_in_bytes": 42.0,
          "": 42.0,
          "fields": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          }
        },
        "docs": {
          "count": 42.0,
          "deleted": 42.0
        },
        "fielddata": {
          "evictions": 42.0,
          "": 42.0,
          "memory_size_in_bytes": 42.0,
          "fields": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          }
        },
        "flush": {
          "periodic": 42.0,
          "total": 42.0,
          "total_time": "string",
          "": 42.0
        },
        "get": {
          "current": 42.0,
          "exists_time": "string",
          "": 42.0,
          "exists_total": 42.0,
          "missing_time": "string",
          "missing_total": 42.0,
          "time": "string",
          "total": 42.0
        },
        "indexing": {
          "index_current": 42.0,
          "delete_current": 42.0,
          "delete_time": "string",
          "": 42.0,
          "delete_total": 42.0,
          "is_throttled": true,
          "noop_update_total": 42.0,
          "throttle_time": "string",
          "index_time": "string",
          "index_total": 42.0,
          "index_failed": 42.0,
          "types": {
            "*": {}
          },
          "write_load": 42.0
        },
        "additionalProperty1": {},
        "additionalProperty2": {},
        "merges": {
          "current": 42.0,
          "current_docs": 42.0,
          "current_size": "string",
          "current_size_in_bytes": 42.0,
          "total": 42.0,
          "total_auto_throttle": "string",
          "total_auto_throttle_in_bytes": 42.0,
          "total_docs": 42.0,
          "total_size": "string",
          "total_size_in_bytes": 42.0,
          "total_stopped_time": "string",
          "": 42.0,
          "total_throttled_time": "string",
          "total_time": "string"
        },
        "query_cache": {
          "cache_count": 42.0,
          "cache_size": 42.0,
          "evictions": 42.0,
          "hit_count": 42.0,
          "": 42.0,
          "memory_size_in_bytes": 42.0,
          "miss_count": 42.0,
          "total_count": 42.0
        },
        "recovery": {
          "current_as_source": 42.0,
          "current_as_target": 42.0,
          "throttle_time": "string",
          "": 42.0
        },
        "refresh": {
          "external_total": 42.0,
          "": 42.0,
          "listeners": 42.0,
          "total": 42.0,
          "total_time": "string"
        },
        "request_cache": {
          "evictions": 42.0,
          "hit_count": 42.0,
          "memory_size": "string",
          "memory_size_in_bytes": 42.0,
          "miss_count": 42.0
        },
        "search": {
          "fetch_current": 42.0,
          "fetch_time": "string",
          "": 42.0,
          "fetch_total": 42.0,
          "open_contexts": 42.0,
          "query_current": 42.0,
          "query_time": "string",
          "query_total": 42.0,
          "scroll_current": 42.0,
          "scroll_time": "string",
          "scroll_total": 42.0,
          "suggest_current": 42.0,
          "suggest_time": "string",
          "suggest_total": 42.0,
          "groups": {
            "*": {}
          }
        },
        "segments": {
          "count": 42.0,
          "": 42.0,
          "doc_values_memory_in_bytes": 42.0,
          "file_sizes": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          },
          "fixed_bit_set_memory_in_bytes": 42.0,
          "index_writer_max_memory_in_bytes": 42.0,
          "index_writer_memory_in_bytes": 42.0,
          "max_unsafe_auto_id_timestamp": 42.0,
          "memory_in_bytes": 42.0,
          "norms_memory_in_bytes": 42.0,
          "points_memory_in_bytes": 42.0,
          "stored_fields_memory_in_bytes": 42.0,
          "terms_memory_in_bytes": 42.0,
          "term_vectors_memory_in_bytes": 42.0,
          "version_map_memory_in_bytes": 42.0
        },
        "store": {
          "": 42.0,
          "size_in_bytes": 42.0,
          "reserved_in_bytes": 42.0,
          "total_data_set_size_in_bytes": 42.0
        },
        "translog": {
          "earliest_last_modified_age": 42.0,
          "operations": 42.0,
          "size": "string",
          "size_in_bytes": 42.0,
          "uncommitted_operations": 42.0,
          "uncommitted_size": "string",
          "uncommitted_size_in_bytes": 42.0
        },
        "warmer": {
          "current": 42.0,
          "total": 42.0,
          "total_time": "string",
          "": 42.0
        },
        "bulk": {
          "total_operations": 42.0,
          "total_time": "string",
          "": 42.0,
          "total_size_in_bytes": 42.0,
          "avg_time": "string",
          "avg_size_in_bytes": 42.0
        },
        "shard_stats": {
          "total_count": 42.0
        }
      },
      "uuid": "string",
      "health": "green",
      "status": "open"
    }
  },
  "_shards": {
    "failed": 42.0,
    "successful": 42.0,
    "total": 42.0,
    "failures": [
      {
        "index": "string",
        "node": "string",
        "reason": {
          "type": "string",
          "reason": "string",
          "stack_trace": "string",
          "caused_by": {},
          "root_cause": [
            {}
          ],
          "suppressed": [
            {}
          ]
        },
        "shard": 42.0,
        "status": "string"
      }
    ],
    "skipped": 42.0
  },
  "additionalProperty1": {
    "primaries": {
      "completion": {
        "size_in_bytes": 42.0,
        "": 42.0,
        "fields": {
          "additionalProperty1": {
            "size_in_bytes": 42.0
          },
          "additionalProperty2": {
            "size_in_bytes": 42.0
          }
        }
      },
      "docs": {
        "count": 42.0,
        "deleted": 42.0
      },
      "fielddata": {
        "evictions": 42.0,
        "": 42.0,
        "memory_size_in_bytes": 42.0,
        "fields": {
          "additionalProperty1": {
            "memory_size_in_bytes": 42.0
          },
          "additionalProperty2": {
            "memory_size_in_bytes": 42.0
          }
        }
      },
      "flush": {
        "periodic": 42.0,
        "total": 42.0,
        "total_time": "string",
        "": 42.0
      },
      "get": {
        "current": 42.0,
        "exists_time": "string",
        "": 42.0,
        "exists_total": 42.0,
        "missing_time": "string",
        "missing_total": 42.0,
        "time": "string",
        "total": 42.0
      },
      "indexing": {
        "index_current": 42.0,
        "delete_current": 42.0,
        "delete_time": "string",
        "": 42.0,
        "delete_total": 42.0,
        "is_throttled": true,
        "noop_update_total": 42.0,
        "throttle_time": "string",
        "index_time": "string",
        "index_total": 42.0,
        "index_failed": 42.0,
        "types": {
          "*": {}
        },
        "write_load": 42.0
      },
      "additionalProperty1": {},
      "additionalProperty2": {},
      "merges": {
        "current": 42.0,
        "current_docs": 42.0,
        "current_size": "string",
        "current_size_in_bytes": 42.0,
        "total": 42.0,
        "total_auto_throttle": "string",
        "total_auto_throttle_in_bytes": 42.0,
        "total_docs": 42.0,
        "total_size": "string",
        "total_size_in_bytes": 42.0,
        "total_stopped_time": "string",
        "": 42.0,
        "total_throttled_time": "string",
        "total_time": "string"
      },
      "query_cache": {
        "cache_count": 42.0,
        "cache_size": 42.0,
        "evictions": 42.0,
        "hit_count": 42.0,
        "": 42.0,
        "memory_size_in_bytes": 42.0,
        "miss_count": 42.0,
        "total_count": 42.0
      },
      "recovery": {
        "current_as_source": 42.0,
        "current_as_target": 42.0,
        "throttle_time": "string",
        "": 42.0
      },
      "refresh": {
        "external_total": 42.0,
        "": 42.0,
        "listeners": 42.0,
        "total": 42.0,
        "total_time": "string"
      },
      "request_cache": {
        "evictions": 42.0,
        "hit_count": 42.0,
        "memory_size": "string",
        "memory_size_in_bytes": 42.0,
        "miss_count": 42.0
      },
      "search": {
        "fetch_current": 42.0,
        "fetch_time": "string",
        "": 42.0,
        "fetch_total": 42.0,
        "open_contexts": 42.0,
        "query_current": 42.0,
        "query_time": "string",
        "query_total": 42.0,
        "scroll_current": 42.0,
        "scroll_time": "string",
        "scroll_total": 42.0,
        "suggest_current": 42.0,
        "suggest_time": "string",
        "suggest_total": 42.0,
        "groups": {
          "*": {}
        }
      },
      "segments": {
        "count": 42.0,
        "": 42.0,
        "doc_values_memory_in_bytes": 42.0,
        "file_sizes": {
          "additionalProperty1": {
            "description": "string",
            "size_in_bytes": 42.0,
            "min_size_in_bytes": 42.0,
            "max_size_in_bytes": 42.0,
            "average_size_in_bytes": 42.0,
            "count": 42.0
          },
          "additionalProperty2": {
            "description": "string",
            "size_in_bytes": 42.0,
            "min_size_in_bytes": 42.0,
            "max_size_in_bytes": 42.0,
            "average_size_in_bytes": 42.0,
            "count": 42.0
          }
        },
        "fixed_bit_set_memory_in_bytes": 42.0,
        "index_writer_max_memory_in_bytes": 42.0,
        "index_writer_memory_in_bytes": 42.0,
        "max_unsafe_auto_id_timestamp": 42.0,
        "memory_in_bytes": 42.0,
        "norms_memory_in_bytes": 42.0,
        "points_memory_in_bytes": 42.0,
        "stored_fields_memory_in_bytes": 42.0,
        "terms_memory_in_bytes": 42.0,
        "term_vectors_memory_in_bytes": 42.0,
        "version_map_memory_in_bytes": 42.0
      },
      "store": {
        "": 42.0,
        "size_in_bytes": 42.0,
        "reserved_in_bytes": 42.0,
        "total_data_set_size_in_bytes": 42.0
      },
      "translog": {
        "earliest_last_modified_age": 42.0,
        "operations": 42.0,
        "size": "string",
        "size_in_bytes": 42.0,
        "uncommitted_operations": 42.0,
        "uncommitted_size": "string",
        "uncommitted_size_in_bytes": 42.0
      },
      "warmer": {
        "current": 42.0,
        "total": 42.0,
        "total_time": "string",
        "": 42.0
      },
      "bulk": {
        "total_operations": 42.0,
        "total_time": "string",
        "": 42.0,
        "total_size_in_bytes": 42.0,
        "avg_time": "string",
        "avg_size_in_bytes": 42.0
      },
      "shard_stats": {
        "total_count": 42.0
      }
    },
    "shards": {
      "additionalProperty1": [
        {
          "commit": {
            "generation": 42.0,
            "id": "string",
            "num_docs": 42.0,
            "user_data": {}
          },
          "completion": {
            "size_in_bytes": 42.0,
            "fields": {}
          },
          "docs": {
            "count": 42.0,
            "deleted": 42.0
          },
          "fielddata": {
            "evictions": 42.0,
            "memory_size_in_bytes": 42.0,
            "fields": {}
          },
          "flush": {
            "periodic": 42.0,
            "total": 42.0,
            "total_time": "string"
          },
          "get": {
            "current": 42.0,
            "exists_time": "string",
            "exists_total": 42.0,
            "missing_time": "string",
            "missing_total": 42.0,
            "time": "string",
            "total": 42.0
          },
          "indexing": {
            "index_current": 42.0,
            "delete_current": 42.0,
            "delete_time": "string",
            "delete_total": 42.0,
            "is_throttled": true,
            "noop_update_total": 42.0,
            "throttle_time": "string",
            "index_time": "string",
            "index_total": 42.0,
            "index_failed": 42.0,
            "types": {},
            "write_load": 42.0
          },
          "mappings": {
            "total_count": 42.0,
            "total_estimated_overhead_in_bytes": 42.0
          },
          "merges": {
            "current": 42.0,
            "current_docs": 42.0,
            "current_size": "string",
            "current_size_in_bytes": 42.0,
            "total": 42.0,
            "total_auto_throttle": "string",
            "total_auto_throttle_in_bytes": 42.0,
            "total_docs": 42.0,
            "total_size": "string",
            "total_size_in_bytes": 42.0,
            "total_stopped_time": "string",
            "total_throttled_time": "string",
            "total_time": "string"
          },
          "shard_path": {
            "data_path": "string",
            "is_custom_data_path": true,
            "state_path": "string"
          },
          "query_cache": {
            "cache_count": 42.0,
            "cache_size": 42.0,
            "evictions": 42.0,
            "hit_count": 42.0,
            "memory_size_in_bytes": 42.0,
            "miss_count": 42.0,
            "total_count": 42.0
          },
          "recovery": {
            "current_as_source": 42.0,
            "current_as_target": 42.0,
            "throttle_time": "string"
          },
          "refresh": {
            "external_total": 42.0,
            "listeners": 42.0,
            "total": 42.0,
            "total_time": "string"
          },
          "request_cache": {
            "evictions": 42.0,
            "hit_count": 42.0,
            "memory_size": "string",
            "memory_size_in_bytes": 42.0,
            "miss_count": 42.0
          },
          "retention_leases": {
            "primary_term": 42.0,
            "version": 42.0,
            "leases": [
              {}
            ]
          },
          "routing": {
            "node": "string",
            "primary": true,
            "state": "UNASSIGNED"
          },
          "search": {
            "fetch_current": 42.0,
            "fetch_time": "string",
            "fetch_total": 42.0,
            "open_contexts": 42.0,
            "query_current": 42.0,
            "query_time": "string",
            "query_total": 42.0,
            "scroll_current": 42.0,
            "scroll_time": "string",
            "scroll_total": 42.0,
            "suggest_current": 42.0,
            "suggest_time": "string",
            "suggest_total": 42.0,
            "groups": {}
          },
          "segments": {
            "count": 42.0,
            "doc_values_memory_in_bytes": 42.0,
            "file_sizes": {},
            "fixed_bit_set_memory_in_bytes": 42.0,
            "index_writer_max_memory_in_bytes": 42.0,
            "index_writer_memory_in_bytes": 42.0,
            "max_unsafe_auto_id_timestamp": 42.0,
            "memory_in_bytes": 42.0,
            "norms_memory_in_bytes": 42.0,
            "points_memory_in_bytes": 42.0,
            "stored_fields_memory_in_bytes": 42.0,
            "terms_memory_in_bytes": 42.0,
            "term_vectors_memory_in_bytes": 42.0,
            "version_map_memory_in_bytes": 42.0
          },
          "seq_no": {
            "global_checkpoint": 42.0,
            "local_checkpoint": 42.0,
            "max_seq_no": 42.0
          },
          "store": {
            "size_in_bytes": 42.0,
            "reserved_in_bytes": 42.0,
            "total_data_set_size_in_bytes": 42.0
          },
          "translog": {
            "earliest_last_modified_age": 42.0,
            "operations": 42.0,
            "size": "string",
            "size_in_bytes": 42.0,
            "uncommitted_operations": 42.0,
            "uncommitted_size": "string",
            "uncommitted_size_in_bytes": 42.0
          },
          "warmer": {
            "current": 42.0,
            "total": 42.0,
            "total_time": "string"
          },
          "bulk": {
            "total_operations": 42.0,
            "total_time": "string",
            "total_size_in_bytes": 42.0,
            "avg_time": "string",
            "avg_size_in_bytes": 42.0
          },
          "shards": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          },
          "shard_stats": {
            "total_count": 42.0
          },
          "additionalProperty1": {},
          "additionalProperty2": {}
        }
      ],
      "additionalProperty2": [
        {
          "commit": {
            "generation": 42.0,
            "id": "string",
            "num_docs": 42.0,
            "user_data": {}
          },
          "completion": {
            "size_in_bytes": 42.0,
            "fields": {}
          },
          "docs": {
            "count": 42.0,
            "deleted": 42.0
          },
          "fielddata": {
            "evictions": 42.0,
            "memory_size_in_bytes": 42.0,
            "fields": {}
          },
          "flush": {
            "periodic": 42.0,
            "total": 42.0,
            "total_time": "string"
          },
          "get": {
            "current": 42.0,
            "exists_time": "string",
            "exists_total": 42.0,
            "missing_time": "string",
            "missing_total": 42.0,
            "time": "string",
            "total": 42.0
          },
          "indexing": {
            "index_current": 42.0,
            "delete_current": 42.0,
            "delete_time": "string",
            "delete_total": 42.0,
            "is_throttled": true,
            "noop_update_total": 42.0,
            "throttle_time": "string",
            "index_time": "string",
            "index_total": 42.0,
            "index_failed": 42.0,
            "types": {},
            "write_load": 42.0
          },
          "mappings": {
            "total_count": 42.0,
            "total_estimated_overhead_in_bytes": 42.0
          },
          "merges": {
            "current": 42.0,
            "current_docs": 42.0,
            "current_size": "string",
            "current_size_in_bytes": 42.0,
            "total": 42.0,
            "total_auto_throttle": "string",
            "total_auto_throttle_in_bytes": 42.0,
            "total_docs": 42.0,
            "total_size": "string",
            "total_size_in_bytes": 42.0,
            "total_stopped_time": "string",
            "total_throttled_time": "string",
            "total_time": "string"
          },
          "shard_path": {
            "data_path": "string",
            "is_custom_data_path": true,
            "state_path": "string"
          },
          "query_cache": {
            "cache_count": 42.0,
            "cache_size": 42.0,
            "evictions": 42.0,
            "hit_count": 42.0,
            "memory_size_in_bytes": 42.0,
            "miss_count": 42.0,
            "total_count": 42.0
          },
          "recovery": {
            "current_as_source": 42.0,
            "current_as_target": 42.0,
            "throttle_time": "string"
          },
          "refresh": {
            "external_total": 42.0,
            "listeners": 42.0,
            "total": 42.0,
            "total_time": "string"
          },
          "request_cache": {
            "evictions": 42.0,
            "hit_count": 42.0,
            "memory_size": "string",
            "memory_size_in_bytes": 42.0,
            "miss_count": 42.0
          },
          "retention_leases": {
            "primary_term": 42.0,
            "version": 42.0,
            "leases": [
              {}
            ]
          },
          "routing": {
            "node": "string",
            "primary": true,
            "state": "UNASSIGNED"
          },
          "search": {
            "fetch_current": 42.0,
            "fetch_time": "string",
            "fetch_total": 42.0,
            "open_contexts": 42.0,
            "query_current": 42.0,
            "query_time": "string",
            "query_total": 42.0,
            "scroll_current": 42.0,
            "scroll_time": "string",
            "scroll_total": 42.0,
            "suggest_current": 42.0,
            "suggest_time": "string",
            "suggest_total": 42.0,
            "groups": {}
          },
          "segments": {
            "count": 42.0,
            "doc_values_memory_in_bytes": 42.0,
            "file_sizes": {},
            "fixed_bit_set_memory_in_bytes": 42.0,
            "index_writer_max_memory_in_bytes": 42.0,
            "index_writer_memory_in_bytes": 42.0,
            "max_unsafe_auto_id_timestamp": 42.0,
            "memory_in_bytes": 42.0,
            "norms_memory_in_bytes": 42.0,
            "points_memory_in_bytes": 42.0,
            "stored_fields_memory_in_bytes": 42.0,
            "terms_memory_in_bytes": 42.0,
            "term_vectors_memory_in_bytes": 42.0,
            "version_map_memory_in_bytes": 42.0
          },
          "seq_no": {
            "global_checkpoint": 42.0,
            "local_checkpoint": 42.0,
            "max_seq_no": 42.0
          },
          "store": {
            "size_in_bytes": 42.0,
            "reserved_in_bytes": 42.0,
            "total_data_set_size_in_bytes": 42.0
          },
          "translog": {
            "earliest_last_modified_age": 42.0,
            "operations": 42.0,
            "size": "string",
            "size_in_bytes": 42.0,
            "uncommitted_operations": 42.0,
            "uncommitted_size": "string",
            "uncommitted_size_in_bytes": 42.0
          },
          "warmer": {
            "current": 42.0,
            "total": 42.0,
            "total_time": "string"
          },
          "bulk": {
            "total_operations": 42.0,
            "total_time": "string",
            "total_size_in_bytes": 42.0,
            "avg_time": "string",
            "avg_size_in_bytes": 42.0
          },
          "shards": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          },
          "shard_stats": {
            "total_count": 42.0
          },
          "additionalProperty1": {},
          "additionalProperty2": {}
        }
      ]
    },
    "total": {
      "completion": {
        "size_in_bytes": 42.0,
        "": 42.0,
        "fields": {
          "additionalProperty1": {
            "size_in_bytes": 42.0
          },
          "additionalProperty2": {
            "size_in_bytes": 42.0
          }
        }
      },
      "docs": {
        "count": 42.0,
        "deleted": 42.0
      },
      "fielddata": {
        "evictions": 42.0,
        "": 42.0,
        "memory_size_in_bytes": 42.0,
        "fields": {
          "additionalProperty1": {
            "memory_size_in_bytes": 42.0
          },
          "additionalProperty2": {
            "memory_size_in_bytes": 42.0
          }
        }
      },
      "flush": {
        "periodic": 42.0,
        "total": 42.0,
        "total_time": "string",
        "": 42.0
      },
      "get": {
        "current": 42.0,
        "exists_time": "string",
        "": 42.0,
        "exists_total": 42.0,
        "missing_time": "string",
        "missing_total": 42.0,
        "time": "string",
        "total": 42.0
      },
      "indexing": {
        "index_current": 42.0,
        "delete_current": 42.0,
        "delete_time": "string",
        "": 42.0,
        "delete_total": 42.0,
        "is_throttled": true,
        "noop_update_total": 42.0,
        "throttle_time": "string",
        "index_time": "string",
        "index_total": 42.0,
        "index_failed": 42.0,
        "types": {
          "*": {}
        },
        "write_load": 42.0
      },
      "additionalProperty1": {},
      "additionalProperty2": {},
      "merges": {
        "current": 42.0,
        "current_docs": 42.0,
        "current_size": "string",
        "current_size_in_bytes": 42.0,
        "total": 42.0,
        "total_auto_throttle": "string",
        "total_auto_throttle_in_bytes": 42.0,
        "total_docs": 42.0,
        "total_size": "string",
        "total_size_in_bytes": 42.0,
        "total_stopped_time": "string",
        "": 42.0,
        "total_throttled_time": "string",
        "total_time": "string"
      },
      "query_cache": {
        "cache_count": 42.0,
        "cache_size": 42.0,
        "evictions": 42.0,
        "hit_count": 42.0,
        "": 42.0,
        "memory_size_in_bytes": 42.0,
        "miss_count": 42.0,
        "total_count": 42.0
      },
      "recovery": {
        "current_as_source": 42.0,
        "current_as_target": 42.0,
        "throttle_time": "string",
        "": 42.0
      },
      "refresh": {
        "external_total": 42.0,
        "": 42.0,
        "listeners": 42.0,
        "total": 42.0,
        "total_time": "string"
      },
      "request_cache": {
        "evictions": 42.0,
        "hit_count": 42.0,
        "memory_size": "string",
        "memory_size_in_bytes": 42.0,
        "miss_count": 42.0
      },
      "search": {
        "fetch_current": 42.0,
        "fetch_time": "string",
        "": 42.0,
        "fetch_total": 42.0,
        "open_contexts": 42.0,
        "query_current": 42.0,
        "query_time": "string",
        "query_total": 42.0,
        "scroll_current": 42.0,
        "scroll_time": "string",
        "scroll_total": 42.0,
        "suggest_current": 42.0,
        "suggest_time": "string",
        "suggest_total": 42.0,
        "groups": {
          "*": {}
        }
      },
      "segments": {
        "count": 42.0,
        "": 42.0,
        "doc_values_memory_in_bytes": 42.0,
        "file_sizes": {
          "additionalProperty1": {
            "description": "string",
            "size_in_bytes": 42.0,
            "min_size_in_bytes": 42.0,
            "max_size_in_bytes": 42.0,
            "average_size_in_bytes": 42.0,
            "count": 42.0
          },
          "additionalProperty2": {
            "description": "string",
            "size_in_bytes": 42.0,
            "min_size_in_bytes": 42.0,
            "max_size_in_bytes": 42.0,
            "average_size_in_bytes": 42.0,
            "count": 42.0
          }
        },
        "fixed_bit_set_memory_in_bytes": 42.0,
        "index_writer_max_memory_in_bytes": 42.0,
        "index_writer_memory_in_bytes": 42.0,
        "max_unsafe_auto_id_timestamp": 42.0,
        "memory_in_bytes": 42.0,
        "norms_memory_in_bytes": 42.0,
        "points_memory_in_bytes": 42.0,
        "stored_fields_memory_in_bytes": 42.0,
        "terms_memory_in_bytes": 42.0,
        "term_vectors_memory_in_bytes": 42.0,
        "version_map_memory_in_bytes": 42.0
      },
      "store": {
        "": 42.0,
        "size_in_bytes": 42.0,
        "reserved_in_bytes": 42.0,
        "total_data_set_size_in_bytes": 42.0
      },
      "translog": {
        "earliest_last_modified_age": 42.0,
        "operations": 42.0,
        "size": "string",
        "size_in_bytes": 42.0,
        "uncommitted_operations": 42.0,
        "uncommitted_size": "string",
        "uncommitted_size_in_bytes": 42.0
      },
      "warmer": {
        "current": 42.0,
        "total": 42.0,
        "total_time": "string",
        "": 42.0
      },
      "bulk": {
        "total_operations": 42.0,
        "total_time": "string",
        "": 42.0,
        "total_size_in_bytes": 42.0,
        "avg_time": "string",
        "avg_size_in_bytes": 42.0
      },
      "shard_stats": {
        "total_count": 42.0
      }
    },
    "uuid": "string",
    "health": "green",
    "status": "open"
  },
  "additionalProperty2": {
    "primaries": {
      "completion": {
        "size_in_bytes": 42.0,
        "": 42.0,
        "fields": {
          "additionalProperty1": {
            "size_in_bytes": 42.0
          },
          "additionalProperty2": {
            "size_in_bytes": 42.0
          }
        }
      },
      "docs": {
        "count": 42.0,
        "deleted": 42.0
      },
      "fielddata": {
        "evictions": 42.0,
        "": 42.0,
        "memory_size_in_bytes": 42.0,
        "fields": {
          "additionalProperty1": {
            "memory_size_in_bytes": 42.0
          },
          "additionalProperty2": {
            "memory_size_in_bytes": 42.0
          }
        }
      },
      "flush": {
        "periodic": 42.0,
        "total": 42.0,
        "total_time": "string",
        "": 42.0
      },
      "get": {
        "current": 42.0,
        "exists_time": "string",
        "": 42.0,
        "exists_total": 42.0,
        "missing_time": "string",
        "missing_total": 42.0,
        "time": "string",
        "total": 42.0
      },
      "indexing": {
        "index_current": 42.0,
        "delete_current": 42.0,
        "delete_time": "string",
        "": 42.0,
        "delete_total": 42.0,
        "is_throttled": true,
        "noop_update_total": 42.0,
        "throttle_time": "string",
        "index_time": "string",
        "index_total": 42.0,
        "index_failed": 42.0,
        "types": {
          "*": {}
        },
        "write_load": 42.0
      },
      "additionalProperty1": {},
      "additionalProperty2": {},
      "merges": {
        "current": 42.0,
        "current_docs": 42.0,
        "current_size": "string",
        "current_size_in_bytes": 42.0,
        "total": 42.0,
        "total_auto_throttle": "string",
        "total_auto_throttle_in_bytes": 42.0,
        "total_docs": 42.0,
        "total_size": "string",
        "total_size_in_bytes": 42.0,
        "total_stopped_time": "string",
        "": 42.0,
        "total_throttled_time": "string",
        "total_time": "string"
      },
      "query_cache": {
        "cache_count": 42.0,
        "cache_size": 42.0,
        "evictions": 42.0,
        "hit_count": 42.0,
        "": 42.0,
        "memory_size_in_bytes": 42.0,
        "miss_count": 42.0,
        "total_count": 42.0
      },
      "recovery": {
        "current_as_source": 42.0,
        "current_as_target": 42.0,
        "throttle_time": "string",
        "": 42.0
      },
      "refresh": {
        "external_total": 42.0,
        "": 42.0,
        "listeners": 42.0,
        "total": 42.0,
        "total_time": "string"
      },
      "request_cache": {
        "evictions": 42.0,
        "hit_count": 42.0,
        "memory_size": "string",
        "memory_size_in_bytes": 42.0,
        "miss_count": 42.0
      },
      "search": {
        "fetch_current": 42.0,
        "fetch_time": "string",
        "": 42.0,
        "fetch_total": 42.0,
        "open_contexts": 42.0,
        "query_current": 42.0,
        "query_time": "string",
        "query_total": 42.0,
        "scroll_current": 42.0,
        "scroll_time": "string",
        "scroll_total": 42.0,
        "suggest_current": 42.0,
        "suggest_time": "string",
        "suggest_total": 42.0,
        "groups": {
          "*": {}
        }
      },
      "segments": {
        "count": 42.0,
        "": 42.0,
        "doc_values_memory_in_bytes": 42.0,
        "file_sizes": {
          "additionalProperty1": {
            "description": "string",
            "size_in_bytes": 42.0,
            "min_size_in_bytes": 42.0,
            "max_size_in_bytes": 42.0,
            "average_size_in_bytes": 42.0,
            "count": 42.0
          },
          "additionalProperty2": {
            "description": "string",
            "size_in_bytes": 42.0,
            "min_size_in_bytes": 42.0,
            "max_size_in_bytes": 42.0,
            "average_size_in_bytes": 42.0,
            "count": 42.0
          }
        },
        "fixed_bit_set_memory_in_bytes": 42.0,
        "index_writer_max_memory_in_bytes": 42.0,
        "index_writer_memory_in_bytes": 42.0,
        "max_unsafe_auto_id_timestamp": 42.0,
        "memory_in_bytes": 42.0,
        "norms_memory_in_bytes": 42.0,
        "points_memory_in_bytes": 42.0,
        "stored_fields_memory_in_bytes": 42.0,
        "terms_memory_in_bytes": 42.0,
        "term_vectors_memory_in_bytes": 42.0,
        "version_map_memory_in_bytes": 42.0
      },
      "store": {
        "": 42.0,
        "size_in_bytes": 42.0,
        "reserved_in_bytes": 42.0,
        "total_data_set_size_in_bytes": 42.0
      },
      "translog": {
        "earliest_last_modified_age": 42.0,
        "operations": 42.0,
        "size": "string",
        "size_in_bytes": 42.0,
        "uncommitted_operations": 42.0,
        "uncommitted_size": "string",
        "uncommitted_size_in_bytes": 42.0
      },
      "warmer": {
        "current": 42.0,
        "total": 42.0,
        "total_time": "string",
        "": 42.0
      },
      "bulk": {
        "total_operations": 42.0,
        "total_time": "string",
        "": 42.0,
        "total_size_in_bytes": 42.0,
        "avg_time": "string",
        "avg_size_in_bytes": 42.0
      },
      "shard_stats": {
        "total_count": 42.0
      }
    },
    "shards": {
      "additionalProperty1": [
        {
          "commit": {
            "generation": 42.0,
            "id": "string",
            "num_docs": 42.0,
            "user_data": {}
          },
          "completion": {
            "size_in_bytes": 42.0,
            "fields": {}
          },
          "docs": {
            "count": 42.0,
            "deleted": 42.0
          },
          "fielddata": {
            "evictions": 42.0,
            "memory_size_in_bytes": 42.0,
            "fields": {}
          },
          "flush": {
            "periodic": 42.0,
            "total": 42.0,
            "total_time": "string"
          },
          "get": {
            "current": 42.0,
            "exists_time": "string",
            "exists_total": 42.0,
            "missing_time": "string",
            "missing_total": 42.0,
            "time": "string",
            "total": 42.0
          },
          "indexing": {
            "index_current": 42.0,
            "delete_current": 42.0,
            "delete_time": "string",
            "delete_total": 42.0,
            "is_throttled": true,
            "noop_update_total": 42.0,
            "throttle_time": "string",
            "index_time": "string",
            "index_total": 42.0,
            "index_failed": 42.0,
            "types": {},
            "write_load": 42.0
          },
          "mappings": {
            "total_count": 42.0,
            "total_estimated_overhead_in_bytes": 42.0
          },
          "merges": {
            "current": 42.0,
            "current_docs": 42.0,
            "current_size": "string",
            "current_size_in_bytes": 42.0,
            "total": 42.0,
            "total_auto_throttle": "string",
            "total_auto_throttle_in_bytes": 42.0,
            "total_docs": 42.0,
            "total_size": "string",
            "total_size_in_bytes": 42.0,
            "total_stopped_time": "string",
            "total_throttled_time": "string",
            "total_time": "string"
          },
          "shard_path": {
            "data_path": "string",
            "is_custom_data_path": true,
            "state_path": "string"
          },
          "query_cache": {
            "cache_count": 42.0,
            "cache_size": 42.0,
            "evictions": 42.0,
            "hit_count": 42.0,
            "memory_size_in_bytes": 42.0,
            "miss_count": 42.0,
            "total_count": 42.0
          },
          "recovery": {
            "current_as_source": 42.0,
            "current_as_target": 42.0,
            "throttle_time": "string"
          },
          "refresh": {
            "external_total": 42.0,
            "listeners": 42.0,
            "total": 42.0,
            "total_time": "string"
          },
          "request_cache": {
            "evictions": 42.0,
            "hit_count": 42.0,
            "memory_size": "string",
            "memory_size_in_bytes": 42.0,
            "miss_count": 42.0
          },
          "retention_leases": {
            "primary_term": 42.0,
            "version": 42.0,
            "leases": [
              {}
            ]
          },
          "routing": {
            "node": "string",
            "primary": true,
            "state": "UNASSIGNED"
          },
          "search": {
            "fetch_current": 42.0,
            "fetch_time": "string",
            "fetch_total": 42.0,
            "open_contexts": 42.0,
            "query_current": 42.0,
            "query_time": "string",
            "query_total": 42.0,
            "scroll_current": 42.0,
            "scroll_time": "string",
            "scroll_total": 42.0,
            "suggest_current": 42.0,
            "suggest_time": "string",
            "suggest_total": 42.0,
            "groups": {}
          },
          "segments": {
            "count": 42.0,
            "doc_values_memory_in_bytes": 42.0,
            "file_sizes": {},
            "fixed_bit_set_memory_in_bytes": 42.0,
            "index_writer_max_memory_in_bytes": 42.0,
            "index_writer_memory_in_bytes": 42.0,
            "max_unsafe_auto_id_timestamp": 42.0,
            "memory_in_bytes": 42.0,
            "norms_memory_in_bytes": 42.0,
            "points_memory_in_bytes": 42.0,
            "stored_fields_memory_in_bytes": 42.0,
            "terms_memory_in_bytes": 42.0,
            "term_vectors_memory_in_bytes": 42.0,
            "version_map_memory_in_bytes": 42.0
          },
          "seq_no": {
            "global_checkpoint": 42.0,
            "local_checkpoint": 42.0,
            "max_seq_no": 42.0
          },
          "store": {
            "size_in_bytes": 42.0,
            "reserved_in_bytes": 42.0,
            "total_data_set_size_in_bytes": 42.0
          },
          "translog": {
            "earliest_last_modified_age": 42.0,
            "operations": 42.0,
            "size": "string",
            "size_in_bytes": 42.0,
            "uncommitted_operations": 42.0,
            "uncommitted_size": "string",
            "uncommitted_size_in_bytes": 42.0
          },
          "warmer": {
            "current": 42.0,
            "total": 42.0,
            "total_time": "string"
          },
          "bulk": {
            "total_operations": 42.0,
            "total_time": "string",
            "total_size_in_bytes": 42.0,
            "avg_time": "string",
            "avg_size_in_bytes": 42.0
          },
          "shards": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          },
          "shard_stats": {
            "total_count": 42.0
          },
          "additionalProperty1": {},
          "additionalProperty2": {}
        }
      ],
      "additionalProperty2": [
        {
          "commit": {
            "generation": 42.0,
            "id": "string",
            "num_docs": 42.0,
            "user_data": {}
          },
          "completion": {
            "size_in_bytes": 42.0,
            "fields": {}
          },
          "docs": {
            "count": 42.0,
            "deleted": 42.0
          },
          "fielddata": {
            "evictions": 42.0,
            "memory_size_in_bytes": 42.0,
            "fields": {}
          },
          "flush": {
            "periodic": 42.0,
            "total": 42.0,
            "total_time": "string"
          },
          "get": {
            "current": 42.0,
            "exists_time": "string",
            "exists_total": 42.0,
            "missing_time": "string",
            "missing_total": 42.0,
            "time": "string",
            "total": 42.0
          },
          "indexing": {
            "index_current": 42.0,
            "delete_current": 42.0,
            "delete_time": "string",
            "delete_total": 42.0,
            "is_throttled": true,
            "noop_update_total": 42.0,
            "throttle_time": "string",
            "index_time": "string",
            "index_total": 42.0,
            "index_failed": 42.0,
            "types": {},
            "write_load": 42.0
          },
          "mappings": {
            "total_count": 42.0,
            "total_estimated_overhead_in_bytes": 42.0
          },
          "merges": {
            "current": 42.0,
            "current_docs": 42.0,
            "current_size": "string",
            "current_size_in_bytes": 42.0,
            "total": 42.0,
            "total_auto_throttle": "string",
            "total_auto_throttle_in_bytes": 42.0,
            "total_docs": 42.0,
            "total_size": "string",
            "total_size_in_bytes": 42.0,
            "total_stopped_time": "string",
            "total_throttled_time": "string",
            "total_time": "string"
          },
          "shard_path": {
            "data_path": "string",
            "is_custom_data_path": true,
            "state_path": "string"
          },
          "query_cache": {
            "cache_count": 42.0,
            "cache_size": 42.0,
            "evictions": 42.0,
            "hit_count": 42.0,
            "memory_size_in_bytes": 42.0,
            "miss_count": 42.0,
            "total_count": 42.0
          },
          "recovery": {
            "current_as_source": 42.0,
            "current_as_target": 42.0,
            "throttle_time": "string"
          },
          "refresh": {
            "external_total": 42.0,
            "listeners": 42.0,
            "total": 42.0,
            "total_time": "string"
          },
          "request_cache": {
            "evictions": 42.0,
            "hit_count": 42.0,
            "memory_size": "string",
            "memory_size_in_bytes": 42.0,
            "miss_count": 42.0
          },
          "retention_leases": {
            "primary_term": 42.0,
            "version": 42.0,
            "leases": [
              {}
            ]
          },
          "routing": {
            "node": "string",
            "primary": true,
            "state": "UNASSIGNED"
          },
          "search": {
            "fetch_current": 42.0,
            "fetch_time": "string",
            "fetch_total": 42.0,
            "open_contexts": 42.0,
            "query_current": 42.0,
            "query_time": "string",
            "query_total": 42.0,
            "scroll_current": 42.0,
            "scroll_time": "string",
            "scroll_total": 42.0,
            "suggest_current": 42.0,
            "suggest_time": "string",
            "suggest_total": 42.0,
            "groups": {}
          },
          "segments": {
            "count": 42.0,
            "doc_values_memory_in_bytes": 42.0,
            "file_sizes": {},
            "fixed_bit_set_memory_in_bytes": 42.0,
            "index_writer_max_memory_in_bytes": 42.0,
            "index_writer_memory_in_bytes": 42.0,
            "max_unsafe_auto_id_timestamp": 42.0,
            "memory_in_bytes": 42.0,
            "norms_memory_in_bytes": 42.0,
            "points_memory_in_bytes": 42.0,
            "stored_fields_memory_in_bytes": 42.0,
            "terms_memory_in_bytes": 42.0,
            "term_vectors_memory_in_bytes": 42.0,
            "version_map_memory_in_bytes": 42.0
          },
          "seq_no": {
            "global_checkpoint": 42.0,
            "local_checkpoint": 42.0,
            "max_seq_no": 42.0
          },
          "store": {
            "size_in_bytes": 42.0,
            "reserved_in_bytes": 42.0,
            "total_data_set_size_in_bytes": 42.0
          },
          "translog": {
            "earliest_last_modified_age": 42.0,
            "operations": 42.0,
            "size": "string",
            "size_in_bytes": 42.0,
            "uncommitted_operations": 42.0,
            "uncommitted_size": "string",
            "uncommitted_size_in_bytes": 42.0
          },
          "warmer": {
            "current": 42.0,
            "total": 42.0,
            "total_time": "string"
          },
          "bulk": {
            "total_operations": 42.0,
            "total_time": "string",
            "total_size_in_bytes": 42.0,
            "avg_time": "string",
            "avg_size_in_bytes": 42.0
          },
          "shards": {
            "additionalProperty1": {},
            "additionalProperty2": {}
          },
          "shard_stats": {
            "total_count": 42.0
          },
          "additionalProperty1": {},
          "additionalProperty2": {}
        }
      ]
    },
    "total": {
      "completion": {
        "size_in_bytes": 42.0,
        "": 42.0,
        "fields": {
          "additionalProperty1": {
            "size_in_bytes": 42.0
          },
          "additionalProperty2": {
            "size_in_bytes": 42.0
          }
        }
      },
      "docs": {
        "count": 42.0,
        "deleted": 42.0
      },
      "fielddata": {
        "evictions": 42.0,
        "": 42.0,
        "memory_size_in_bytes": 42.0,
        "fields": {
          "additionalProperty1": {
            "memory_size_in_bytes": 42.0
          },
          "additionalProperty2": {
            "memory_size_in_bytes": 42.0
          }
        }
      },
      "flush": {
        "periodic": 42.0,
        "total": 42.0,
        "total_time": "string",
        "": 42.0
      },
      "get": {
        "current": 42.0,
        "exists_time": "string",
        "": 42.0,
        "exists_total": 42.0,
        "missing_time": "string",
        "missing_total": 42.0,
        "time": "string",
        "total": 42.0
      },
      "indexing": {
        "index_current": 42.0,
        "delete_current": 42.0,
        "delete_time": "string",
        "": 42.0,
        "delete_total": 42.0,
        "is_throttled": true,
        "noop_update_total": 42.0,
        "throttle_time": "string",
        "index_time": "string",
        "index_total": 42.0,
        "index_failed": 42.0,
        "types": {
          "*": {}
        },
        "write_load": 42.0
      },
      "additionalProperty1": {},
      "additionalProperty2": {},
      "merges": {
        "current": 42.0,
        "current_docs": 42.0,
        "current_size": "string",
        "current_size_in_bytes": 42.0,
        "total": 42.0,
        "total_auto_throttle": "string",
        "total_auto_throttle_in_bytes": 42.0,
        "total_docs": 42.0,
        "total_size": "string",
        "total_size_in_bytes": 42.0,
        "total_stopped_time": "string",
        "": 42.0,
        "total_throttled_time": "string",
        "total_time": "string"
      },
      "query_cache": {
        "cache_count": 42.0,
        "cache_size": 42.0,
        "evictions": 42.0,
        "hit_count": 42.0,
        "": 42.0,
        "memory_size_in_bytes": 42.0,
        "miss_count": 42.0,
        "total_count": 42.0
      },
      "recovery": {
        "current_as_source": 42.0,
        "current_as_target": 42.0,
        "throttle_time": "string",
        "": 42.0
      },
      "refresh": {
        "external_total": 42.0,
        "": 42.0,
        "listeners": 42.0,
        "total": 42.0,
        "total_time": "string"
      },
      "request_cache": {
        "evictions": 42.0,
        "hit_count": 42.0,
        "memory_size": "string",
        "memory_size_in_bytes": 42.0,
        "miss_count": 42.0
      },
      "search": {
        "fetch_current": 42.0,
        "fetch_time": "string",
        "": 42.0,
        "fetch_total": 42.0,
        "open_contexts": 42.0,
        "query_current": 42.0,
        "query_time": "string",
        "query_total": 42.0,
        "scroll_current": 42.0,
        "scroll_time": "string",
        "scroll_total": 42.0,
        "suggest_current": 42.0,
        "suggest_time": "string",
        "suggest_total": 42.0,
        "groups": {
          "*": {}
        }
      },
      "segments": {
        "count": 42.0,
        "": 42.0,
        "doc_values_memory_in_bytes": 42.0,
        "file_sizes": {
          "additionalProperty1": {
            "description": "string",
            "size_in_bytes": 42.0,
            "min_size_in_bytes": 42.0,
            "max_size_in_bytes": 42.0,
            "average_size_in_bytes": 42.0,
            "count": 42.0
          },
          "additionalProperty2": {
            "description": "string",
            "size_in_bytes": 42.0,
            "min_size_in_bytes": 42.0,
            "max_size_in_bytes": 42.0,
            "average_size_in_bytes": 42.0,
            "count": 42.0
          }
        },
        "fixed_bit_set_memory_in_bytes": 42.0,
        "index_writer_max_memory_in_bytes": 42.0,
        "index_writer_memory_in_bytes": 42.0,
        "max_unsafe_auto_id_timestamp": 42.0,
        "memory_in_bytes": 42.0,
        "norms_memory_in_bytes": 42.0,
        "points_memory_in_bytes": 42.0,
        "stored_fields_memory_in_bytes": 42.0,
        "terms_memory_in_bytes": 42.0,
        "term_vectors_memory_in_bytes": 42.0,
        "version_map_memory_in_bytes": 42.0
      },
      "store": {
        "": 42.0,
        "size_in_bytes": 42.0,
        "reserved_in_bytes": 42.0,
        "total_data_set_size_in_bytes": 42.0
      },
      "translog": {
        "earliest_last_modified_age": 42.0,
        "operations": 42.0,
        "size": "string",
        "size_in_bytes": 42.0,
        "uncommitted_operations": 42.0,
        "uncommitted_size": "string",
        "uncommitted_size_in_bytes": 42.0
      },
      "warmer": {
        "current": 42.0,
        "total": 42.0,
        "total_time": "string",
        "": 42.0
      },
      "bulk": {
        "total_operations": 42.0,
        "total_time": "string",
        "": 42.0,
        "total_size_in_bytes": 42.0,
        "avg_time": "string",
        "avg_size_in_bytes": 42.0
      },
      "shard_stats": {
        "total_count": 42.0
      }
    },
    "uuid": "string",
    "health": "green",
    "status": "open"
  }
}




















Validate a query Added in 1.3.0

GET /_validate/query

Validates a query without running it.

Query parameters

  • 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.

  • all_shards boolean

    If true, the validation is executed on all shards instead of one random shard per index.

  • analyzer string

    Analyzer to use for the query string. This parameter can only be used when the q query string parameter is specified.

  • If true, wildcard and prefix queries are analyzed.

  • The default operator for query string query: AND or OR.

    Values are and, AND, or, or OR.

  • df string

    Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified.

  • expand_wildcards string | 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.

  • explain boolean

    If true, the response returns detailed information if an error has occurred.

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

  • lenient boolean

    If true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.

  • rewrite boolean

    If true, returns a more detailed explanation showing the actual Lucene query that will be executed.

  • q string

    Query in the Lucene query string syntax.

application/json

Body

  • query object

    An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

    Additional properties are allowed.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
GET /_validate/query
curl \
 -X GET http://api.example.com/_validate/query \
 -H "Content-Type: application/json" \
 -d '{"query":{}}'
Request examples
{
  "query": {}
}
Response examples (200)
{
  "explanations": [
    {
      "error": "string",
      "explanation": "string",
      "index": "string",
      "valid": true
    }
  ],
  "_shards": {
    "failed": 42.0,
    "successful": 42.0,
    "total": 42.0,
    "failures": [
      {
        "index": "string",
        "node": "string",
        "reason": {
          "type": "string",
          "reason": "string",
          "stack_trace": "string",
          "caused_by": {},
          "root_cause": [
            {}
          ],
          "suppressed": [
            {}
          ]
        },
        "shard": 42.0,
        "status": "string"
      }
    ],
    "skipped": 42.0
  },
  "valid": true,
  "error": "string"
}

































Get the ILM status Added in 6.6.0

GET /_ilm/status

Get the current index lifecycle management status.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
GET /_ilm/status
curl \
 -X GET http://api.example.com/_ilm/status
Response examples (200)
A successful response when retrieving the current ILM status.
{
  "operation_mode": "RUNNING"
}













































Create an inference endpoint Added in 8.11.0

PUT /_inference/{task_type}/{inference_id}

When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. After creating the endpoint, wait for the model deployment to complete before using it. To verify the deployment status, use the get trained model statistics API. Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.

IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Mistral, Azure OpenAI, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.

Path parameters

  • task_type string Required

    The task type

    Values are sparse_embedding, text_embedding, rerank, or completion.

  • inference_id string Required

    The inference Id

application/json

Body Required

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
PUT /_inference/{task_type}/{inference_id}
curl \
 -X PUT http://api.example.com/_inference/{task_type}/{inference_id} \
 -H "Content-Type: application/json" \
 -d '{"service":"string","service_settings":{},"task_settings":{}}'
Request examples
{
  "service": "string",
  "service_settings": {},
  "task_settings": {}
}
Response examples (200)
{
  "service": "string",
  "service_settings": {},
  "task_settings": {},
  "inference_id": "string",
  "task_type": "sparse_embedding"
}
























Update an inference endpoint Added in 8.17.0

POST /_inference/{task_type}/{inference_id}/_update

Modify task_settings, secrets (within service_settings), or num_allocations for an inference endpoint, depending on the specific endpoint service and task_type.

IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.

Path parameters

  • task_type string Required

    The type of inference task that the model performs.

    Values are sparse_embedding, text_embedding, rerank, or completion.

  • inference_id string Required

    The unique identifier of the inference endpoint.

application/json

Body Required

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
POST /_inference/{task_type}/{inference_id}/_update
curl \
 -X POST http://api.example.com/_inference/{task_type}/{inference_id}/_update \
 -H "Content-Type: application/json" \
 -d '{"service":"string","service_settings":{},"task_settings":{}}'
Request examples
{
  "service": "string",
  "service_settings": {},
  "task_settings": {}
}
Response examples (200)
{
  "service": "string",
  "service_settings": {},
  "task_settings": {},
  "inference_id": "string",
  "task_type": "sparse_embedding"
}
































































































































Get Logstash pipelines Added in 7.12.0

GET /_logstash/pipeline/{id}

Get pipelines that are used for Logstash Central Management.

Path parameters

  • id string | array[string] Required

    A comma-separated list of pipeline identifiers.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • * object Additional properties

      Additional properties are allowed.

      Hide * attributes Show * attributes object
      • description string Required

        A description of the pipeline. This description is not used by Elasticsearch or Logstash.

      • last_modified string | number Required

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

      • pipeline string Required

        The configuration for the pipeline.

      • pipeline_metadata object Required

        Additional properties are allowed.

        Hide pipeline_metadata attributes Show pipeline_metadata attributes object
      • pipeline_settings object Required

        Additional properties are allowed.

        Hide pipeline_settings attributes Show pipeline_settings attributes object
        • pipeline.workers number Required

          The number of workers that will, in parallel, execute the filter and output stages of the pipeline.

        • pipeline.batch.size number Required

          The maximum number of events an individual worker thread will collect from inputs before attempting to execute its filters and outputs.

        • pipeline.batch.delay number Required

          When creating pipeline event batches, how long in milliseconds to wait for each event before dispatching an undersized batch to pipeline workers.

        • queue.type string Required

          The internal queuing model to use for event buffering.

        • queue.max_bytes.number number Required

          The total capacity of the queue (queue.type: persisted) in number of bytes.

        • queue.max_bytes.units string Required

          The total capacity of the queue (queue.type: persisted) in terms of units of bytes.

        • The maximum number of written events before forcing a checkpoint when persistent queues are enabled (queue.type: persisted).

      • username string Required

        The user who last updated the pipeline.

GET /_logstash/pipeline/{id}
curl \
 -X GET http://api.example.com/_logstash/pipeline/{id}
Response examples (200)
{
  "additionalProperty1": {
    "description": "string",
    "": "string",
    "pipeline": "string",
    "pipeline_metadata": {
      "type": "string",
      "version": "string"
    },
    "pipeline_settings": {
      "pipeline.workers": 42.0,
      "pipeline.batch.size": 42.0,
      "pipeline.batch.delay": 42.0,
      "queue.type": "string",
      "queue.max_bytes.number": 42.0,
      "queue.max_bytes.units": "string",
      "queue.checkpoint.writes": 42.0
    },
    "username": "string"
  },
  "additionalProperty2": {
    "description": "string",
    "": "string",
    "pipeline": "string",
    "pipeline_metadata": {
      "type": "string",
      "version": "string"
    },
    "pipeline_settings": {
      "pipeline.workers": 42.0,
      "pipeline.batch.size": 42.0,
      "pipeline.batch.delay": 42.0,
      "queue.type": "string",
      "queue.max_bytes.number": 42.0,
      "queue.max_bytes.units": "string",
      "queue.checkpoint.writes": 42.0
    },
    "username": "string"
  }
}
























Set upgrade_mode for ML indices Added in 6.7.0

POST /_ml/set_upgrade_mode

Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. When upgrading your cluster, in some circumstances you must restart your nodes and reindex your machine learning indices. In those circumstances, there must be no machine learning jobs running. You can close the machine learning jobs, do the upgrade, then open all the jobs again. Alternatively, you can use this API to temporarily halt tasks associated with the jobs and datafeeds and prevent new jobs from opening. You can also use this API during upgrades that do not require you to reindex your machine learning indices, though stopping jobs is not a requirement in that case. You can see the current value for the upgrade_mode setting by using the get machine learning info API.

Query parameters

  • enabled boolean

    When true, it enables upgrade_mode which temporarily halts all job and datafeed tasks and prohibits new job and datafeed tasks from starting.

  • timeout string

    The time to wait for the request to be completed.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • acknowledged boolean Required

      For a successful response, this value is always true. On failure, an exception is returned instead.

POST /_ml/set_upgrade_mode
curl \
 -X POST http://api.example.com/_ml/set_upgrade_mode
Response examples (200)
{
  "acknowledged": true
}





























Delete anomaly jobs from a calendar Added in 6.2.0

DELETE /_ml/calendars/{calendar_id}/jobs/{job_id}

Path parameters

  • calendar_id string Required

    A string that uniquely identifies a calendar.

  • job_id string | array[string] Required

    An identifier for the anomaly detection jobs. It can be a job identifier, a group name, or a comma-separated list of jobs or groups.

Responses

DELETE /_ml/calendars/{calendar_id}/jobs/{job_id}
curl \
 -X DELETE http://api.example.com/_ml/calendars/{calendar_id}/jobs/{job_id}
Response examples (200)
{
  "calendar_id": "string",
  "description": "string",
  "": "string"
}




























Delete a filter Added in 5.4.0

DELETE /_ml/filters/{filter_id}

If an anomaly detection job references the filter, you cannot delete the filter. You must update or delete the job before you can delete the filter.

Path parameters

  • filter_id string Required

    A string that uniquely identifies a filter.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • acknowledged boolean Required

      For a successful response, this value is always true. On failure, an exception is returned instead.

DELETE /_ml/filters/{filter_id}
curl \
 -X DELETE http://api.example.com/_ml/filters/{filter_id}
Response examples (200)
{
  "acknowledged": true
}

Predict future behavior of a time series Added in 6.1.0

POST /_ml/anomaly_detectors/{job_id}/_forecast

Forecasts are not supported for jobs that perform population analysis; an error occurs if you try to create a forecast for a job that has an over_field_name in its configuration. Forcasts predict future behavior based on historical data.

Path parameters

  • job_id string Required

    Identifier for the anomaly detection job. The job must be open when you create a forecast; otherwise, an error occurs.

Query parameters

  • duration string

    A period of time that indicates how far into the future to forecast. For example, 30d corresponds to 30 days. The forecast starts at the last record that was processed.

  • The period of time that forecast results are retained. After a forecast expires, the results are deleted. If set to a value of 0, the forecast is never automatically deleted.

  • The maximum memory the forecast can use. If the forecast needs to use more than the provided amount, it will spool to disk. Default is 20mb, maximum is 500mb and minimum is 1mb. If set to 40% or more of the job’s configured memory limit, it is automatically reduced to below that amount.

application/json

Body

  • duration string

    A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

  • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

  • Refer to the description for the max_model_memory query parameter.

Responses

POST /_ml/anomaly_detectors/{job_id}/_forecast
curl \
 -X POST http://api.example.com/_ml/anomaly_detectors/{job_id}/_forecast \
 -H "Content-Type: application/json" \
 -d '{"duration":"string","expires_in":"string","max_model_memory":"string"}'
Request examples
{
  "duration": "string",
  "expires_in": "string",
  "max_model_memory": "string"
}
Response examples (200)
{
  "acknowledged": true,
  "forecast_id": "string"
}




























Delete a model snapshot Added in 5.4.0

DELETE /_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}

You cannot delete the active model snapshot. To delete that snapshot, first revert to a different one. To identify the active model snapshot, refer to the model_snapshot_id in the results from the get jobs API.

Path parameters

  • job_id string Required

    Identifier for the anomaly detection job.

  • snapshot_id string Required

    Identifier for the model snapshot.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • acknowledged boolean Required

      For a successful response, this value is always true. On failure, an exception is returned instead.

DELETE /_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}
curl \
 -X DELETE http://api.example.com/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}
Response examples (200)
{
  "acknowledged": true
}
















Get anomaly detection job results for buckets Added in 5.4.0

GET /_ml/anomaly_detectors/{job_id}/results/buckets

The API presents a chronological view of the records, grouped by bucket.

Path parameters

  • job_id string Required

    Identifier for the anomaly detection job.

Query parameters

  • Returns buckets with anomaly scores greater or equal than this value.

  • desc boolean

    If true, the buckets are sorted in descending order.

  • end string | number

    Returns buckets with timestamps earlier than this time. -1 means it is unset and results are not limited to specific timestamps.

  • If true, the output excludes interim results.

  • expand boolean

    If true, the output includes anomaly records.

  • from number

    Skips the specified number of buckets.

  • size number

    Specifies the maximum number of buckets to obtain.

  • sort string

    Specifies the sort field for the requested buckets.

  • start string | number

    Returns buckets with timestamps after this time. -1 means it is unset and results are not limited to specific timestamps.

application/json

Body

  • Refer to the description for the anomaly_score query parameter.

  • desc boolean

    Refer to the description for the desc query parameter.

  • end string | number

    A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

  • Refer to the description for the exclude_interim query parameter.

  • expand boolean

    Refer to the description for the expand query parameter.

  • page object

    Additional properties are allowed.

    Hide page attributes Show page attributes object
    • from number

      Skips the specified number of items.

    • size number

      Specifies the maximum number of items to obtain.

  • sort string

    Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

  • start string | number

    A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • buckets array[object] Required
      Hide buckets attributes Show buckets attributes object
      • anomaly_score number Required

        The maximum anomaly score, between 0-100, for any of the bucket influencers. This is an overall, rate-limited score for the job. All the anomaly records in the bucket contribute to this score. This value might be updated as new data is analyzed.

      • bucket_influencers array[object] Required
        Hide bucket_influencers attributes Show bucket_influencers attributes object
        • anomaly_score number Required

          A normalized score between 0-100, which is calculated for each bucket influencer. This score might be updated as newer data is analyzed.

        • Time unit for seconds

        • influencer_field_name string Required

          Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

        • initial_anomaly_score number Required

          The score between 0-100 for each bucket influencer. This score is the initial value that was calculated at the time the bucket was processed.

        • is_interim boolean Required

          If true, this is an interim result. In other words, the results are calculated based on partial input data.

        • job_id string Required
        • probability number Required

          The probability that the bucket has this behavior, in the range 0 to 1. This value can be held to a high precision of over 300 decimal places, so the anomaly_score is provided as a human-readable and friendly interpretation of this.

        • raw_anomaly_score number Required

          Internal.

        • result_type string Required

          Internal. This value is always set to bucket_influencer.

        • Time unit for milliseconds

      • Time unit for seconds

      • event_count number Required

        The number of input data records processed in this bucket.

      • initial_anomaly_score number Required

        The maximum anomaly score for any of the bucket influencers. This is the initial value that was calculated at the time the bucket was processed.

      • is_interim boolean Required

        If true, this is an interim result. In other words, the results are calculated based on partial input data.

      • job_id string Required
      • Time unit for milliseconds

      • result_type string Required

        Internal. This value is always set to bucket.

      • Time unit for milliseconds

      • timestamp_string string | number

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

    • count number Required
GET /_ml/anomaly_detectors/{job_id}/results/buckets
curl \
 -X GET http://api.example.com/_ml/anomaly_detectors/{job_id}/results/buckets \
 -H "Content-Type: application/json" \
 -d '{"anomaly_score":42.0,"desc":true,"":"string","exclude_interim":true,"expand":true,"page":{"from":42.0,"size":42.0},"sort":"string"}'
Request examples
{
  "anomaly_score": 42.0,
  "desc": true,
  "": "string",
  "exclude_interim": true,
  "expand": true,
  "page": {
    "from": 42.0,
    "size": 42.0
  },
  "sort": "string"
}
Response examples (200)
{
  "buckets": [
    {
      "anomaly_score": 42.0,
      "bucket_influencers": [
        {
          "anomaly_score": 42.0,
          "": "string",
          "influencer_field_name": "string",
          "initial_anomaly_score": 42.0,
          "is_interim": true,
          "job_id": "string",
          "probability": 42.0,
          "raw_anomaly_score": 42.0,
          "result_type": "string"
        }
      ],
      "": "string",
      "event_count": 42.0,
      "initial_anomaly_score": 42.0,
      "is_interim": true,
      "job_id": "string",
      "result_type": "string"
    }
  ],
  "count": 42.0
}
























Get anomaly detection job results for categories Added in 5.4.0

POST /_ml/anomaly_detectors/{job_id}/results/categories/{category_id}

Path parameters

  • job_id string Required

    Identifier for the anomaly detection job.

  • category_id string Required

    Identifier for the category, which is unique in the job. If you specify neither the category ID nor the partition_field_value, the API returns information about all categories. If you specify only the partition_field_value, it returns information about all categories for the specified partition.

Query parameters

  • from number

    Skips the specified number of categories.

  • Only return categories for the specified partition.

  • size number

    Specifies the maximum number of categories to obtain.

application/json

Body

  • page object

    Additional properties are allowed.

    Hide page attributes Show page attributes object
    • from number

      Skips the specified number of items.

    • size number

      Specifies the maximum number of items to obtain.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • categories array[object] Required
      Hide categories attributes Show categories attributes object
      • category_id number Required
      • examples array[string] Required

        A list of examples of actual values that matched the category.

      • job_id string Required
      • max_matching_length number Required
      • If per-partition categorization is enabled, this property identifies the field used to segment the categorization. It is not present when per-partition categorization is disabled.

      • If per-partition categorization is enabled, this property identifies the value of the partition_field_name for the category. It is not present when per-partition categorization is disabled.

      • regex string Required

        A regular expression that is used to search for values that match the category.

      • terms string Required

        A space separated list of the common tokens that are matched in values of the category.

      • The number of messages that have been matched by this category. This is only guaranteed to have the latest accurate count after a job _flush or _close

      • A list of category_id entries that this current category encompasses. Any new message that is processed by the categorizer will match against this category and not any of the categories in this list. This is only guaranteed to have the latest accurate list of categories after a job _flush or _close

      • p string
      • result_type string Required
      • mlcategory string Required
    • count number Required
POST /_ml/anomaly_detectors/{job_id}/results/categories/{category_id}
curl \
 -X POST http://api.example.com/_ml/anomaly_detectors/{job_id}/results/categories/{category_id} \
 -H "Content-Type: application/json" \
 -d '{"page":{"from":42.0,"size":42.0}}'
Request examples
{
  "page": {
    "from": 42.0,
    "size": 42.0
  }
}
Response examples (200)
{
  "categories": [
    {
      "category_id": 42.0,
      "examples": [
        "string"
      ],
      "grok_pattern": "string",
      "job_id": "string",
      "max_matching_length": 42.0,
      "partition_field_name": "string",
      "partition_field_value": "string",
      "regex": "string",
      "terms": "string",
      "num_matches": 42.0,
      "preferred_to_categories": [
        "string"
      ],
      "p": "string",
      "result_type": "string",
      "mlcategory": "string"
    }
  ],
  "count": 42.0
}
























Get anomaly detection job results for influencers Added in 5.4.0

GET /_ml/anomaly_detectors/{job_id}/results/influencers

Influencers are the entities that have contributed to, or are to blame for, the anomalies. Influencer results are available only if an influencer_field_name is specified in the job configuration.

Path parameters

  • job_id string Required

    Identifier for the anomaly detection job.

Query parameters

  • desc boolean

    If true, the results are sorted in descending order.

  • end string | number

    Returns influencers with timestamps earlier than this time. The default value means it is unset and results are not limited to specific timestamps.

  • If true, the output excludes interim results. By default, interim results are included.

  • Returns influencers with anomaly scores greater than or equal to this value.

  • from number

    Skips the specified number of influencers.

  • size number

    Specifies the maximum number of influencers to obtain.

  • sort string

    Specifies the sort field for the requested influencers. By default, the influencers are sorted by the influencer_score value.

  • start string | number

    Returns influencers with timestamps after this time. The default value means it is unset and results are not limited to specific timestamps.

application/json

Body

  • page object

    Additional properties are allowed.

    Hide page attributes Show page attributes object
    • from number

      Skips the specified number of items.

    • size number

      Specifies the maximum number of items to obtain.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • count number Required
    • influencers array[object] Required

      Array of influencer objects

      Hide influencers attributes Show influencers attributes object
      • Time unit for seconds

      • influencer_score number Required

        A normalized score between 0-100, which is based on the probability of the influencer in this bucket aggregated across detectors. Unlike initial_influencer_score, this value is updated by a re-normalization process as new data is analyzed.

      • influencer_field_name string Required

        Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • influencer_field_value string Required

        The entity that influenced, contributed to, or was to blame for the anomaly.

      • A normalized score between 0-100, which is based on the probability of the influencer aggregated across detectors. This is the initial value that was calculated at the time the bucket was processed.

      • is_interim boolean Required

        If true, this is an interim result. In other words, the results are calculated based on partial input data.

      • job_id string Required
      • probability number Required

        The probability that the influencer has this behavior, in the range 0 to 1. This value can be held to a high precision of over 300 decimal places, so the influencer_score is provided as a human-readable and friendly interpretation of this value.

      • result_type string Required

        Internal. This value is always set to influencer.

      • Time unit for milliseconds

      • foo string

        Additional influencer properties are added, depending on the fields being analyzed. For example, if it’s analyzing user_name as an influencer, a field user_name is added to the result document. This information enables you to filter the anomaly results more easily.

GET /_ml/anomaly_detectors/{job_id}/results/influencers
curl \
 -X GET http://api.example.com/_ml/anomaly_detectors/{job_id}/results/influencers \
 -H "Content-Type: application/json" \
 -d '{"page":{"from":42.0,"size":42.0}}'
Request examples
{
  "page": {
    "from": 42.0,
    "size": 42.0
  }
}
Response examples (200)
{
  "count": 42.0,
  "influencers": [
    {
      "": 42.0,
      "influencer_score": 42.0,
      "influencer_field_name": "string",
      "influencer_field_value": "string",
      "initial_influencer_score": 42.0,
      "is_interim": true,
      "job_id": "string",
      "probability": 42.0,
      "result_type": "string",
      "foo": "string"
    }
  ]
}












Get anomaly detection jobs configuration info Added in 5.5.0

GET /_ml/anomaly_detectors

You can get information for multiple anomaly detection jobs in a single API request by using a group name, a comma-separated list of jobs, or a wildcard expression. You can get information for all anomaly detection jobs by using _all, by specifying * as the <job_id>, or by omitting the <job_id>.

Query parameters

  • Specifies what to do when the request:

    1. Contains wildcard expressions and there are no jobs that match.
    2. Contains the _all string or no identifiers and there are no matches.
    3. Contains wildcard expressions and there are only partial matches.

    The default value is true, which returns an empty jobs array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.

  • Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • count number Required
    • jobs array[object] Required
      Hide jobs attributes Show jobs attributes object
      • allow_lazy_open boolean Required

        Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node.

      • analysis_config object Required

        Additional properties are allowed.

        Hide analysis_config attributes Show analysis_config attributes object
        • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

        • categorization_analyzer string | object

          One of:
        • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

        • If categorization_field_name is specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL statements that appear in your log files. This property cannot be used at the same time as categorization_analyzer. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, use the categorization_analyzer property instead and include the filters as pattern_replace character filters. The effect is exactly the same.

        • detectors array[object] Required

          Detector configuration objects specify which data fields a job analyzes. They also specify which analytical functions are used. You can specify multiple detectors for a job. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned.

          Hide detectors attributes Show detectors attributes object
          • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

          • custom_rules array[object]

            Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules.

          • A description of the detector.

          • A unique identifier for the detector. This identifier is based on the order of the detectors in the analysis_config, starting at zero. If you specify a value for this property, it is ignored.

          • Values are all, none, by, or over.

          • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

          • function string

            The analysis function that is used. For example, count, rare, mean, min, max, or sum.

          • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

          • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

          • use_null boolean

            Defines whether a new series is used as the null series when there is no value for the by or partition fields.

        • influencers array[string]

          Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

        • latency string

          A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

        • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

        • This functionality is reserved for internal use. It is not supported for use in customer environments and is not subject to the support SLA of official GA features. If set to true, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. For example, suppose CPU and memory usage on host A is usually highly correlated with the same metrics on host B. Perhaps this correlation occurs because they are running a load-balanced application. If you enable this property, anomalies will be reported when, for example, CPU usage on host A is high and the value of CPU usage on host B is low. That is to say, you’ll see an anomaly when the CPU of host A is unusual given the CPU of host B. To use the multivariate_by_fields property, you must also specify by_field_name in your detector.

        • Additional properties are allowed.

          Hide per_partition_categorization attributes Show per_partition_categorization attributes object
          • enabled boolean

            To enable this setting, you must also set the partition_field_name property to the same value in every detector that uses the keyword mlcategory. Otherwise, job creation fails.

          • This setting can be set to true only if per-partition categorization is enabled. If true, both categorization and subsequent anomaly detection stops for partitions where the categorization status changes to warn. This setting makes it viable to have a job where it is expected that categorization works well for some partitions but not others; you do not pay the cost of bad categorization forever in the partitions where it works badly.

        • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • Additional properties are allowed.

        Hide analysis_limits attributes Show analysis_limits attributes object
      • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

      • blocked object

        Additional properties are allowed.

        Hide blocked attributes Show blocked attributes object
      • create_time string | number

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

      • Custom metadata about the job

        Additional properties are allowed.

      • Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to model_snapshot_retention_days.

      • data_description object Required

        Additional properties are allowed.

        Hide data_description attributes Show data_description attributes object
        • format string

          Only JSON format is supported at this time.

        • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

        • The time format, which can be epoch, epoch_ms, or a custom pattern. The value epoch refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). The value epoch_ms indicates that time is measured in milliseconds since the epoch. The epoch and epoch_ms time formats accept either integer or real values. Custom patterns must conform to the Java DateTimeFormatter class. When you use date-time formatting patterns, it is recommended that you provide the full date, time and time zone. For example: yyyy-MM-dd'T'HH:mm:ssX. If the pattern that you specify is not sufficient to produce a complete timestamp, job creation fails.

      • Additional properties are allowed.

        Hide datafeed_config attributes Show datafeed_config attributes object
        • Additional properties are allowed.

          Hide authorization attributes Show authorization attributes object
          • api_key object

            Additional properties are allowed.

            Hide api_key attributes Show api_key attributes object
            • id string Required

              The identifier for the API key.

            • name string Required

              The name of the API key.

          • roles array[string]

            If a user ID was used for the most recent update to the datafeed, its roles at the time of the update are listed in the response.

          • If a service account was used for the most recent update to the datafeed, the account name is listed in the response.

        • Additional properties are allowed.

          Hide chunking_config attributes Show chunking_config attributes object
          • mode string Required

            Values are auto, manual, or off.

          • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

        • datafeed_id string Required
        • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

        • indices array[string] Required
        • indexes array[string]
        • job_id string Required
        • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

        • Hide script_fields attribute Show script_fields attribute object
          • * object Additional properties

            Additional properties are allowed.

            Hide * attributes Show * attributes object
        • Additional properties are allowed.

          Hide delayed_data_check_config attributes Show delayed_data_check_config attributes object
          • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

          • enabled boolean Required

            Specifies whether the datafeed periodically checks for delayed data.

        • Hide runtime_mappings attribute Show runtime_mappings attribute object
          • * object Additional properties

            Additional properties are allowed.

            Hide * attributes Show * attributes object
            • fields object

              For type composite

            • fetch_fields array[object]

              For type lookup

            • format string

              A custom format for date type runtime fields.

            • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

            • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

            • script object

              Additional properties are allowed.

            • type string Required

              Values are boolean, composite, date, double, geo_point, ip, keyword, long, or lookup.

        • Additional properties are allowed.

          Hide indices_options attributes Show indices_options attributes object
          • 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. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

          • expand_wildcards string | array[string]
          • If true, missing or closed indices are not included in the response.

          • If true, concrete, expanded or aliased indices are ignored when frozen.

        • query object Required

          The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. By default, this property has the following value: {"match_all": {"boost": 1}}.

          Additional properties are allowed.

      • deleting boolean

        Indicates that the process of deleting the job is in progress but not yet completed. It is only reported when true.

      • A description of the job.

      • finished_time string | number

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

      • groups array[string]

        A list of job groups. A job can belong to no groups or many.

      • job_id string Required
      • job_type string

        Reserved for future use, currently set to anomaly_detector.

      • Additional properties are allowed.

        Hide model_plot_config attributes Show model_plot_config attributes object
        • If true, enables calculation and storage of the model change annotations for each entity that is being analyzed.

        • enabled boolean

          If true, enables calculation and storage of the model bounds for each entity that is being analyzed.

        • terms string

          Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted.

      • Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen. The default value is the longer of 30 days or 100 bucket_spans.

      • results_index_name string Required
      • Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever.

GET /_ml/anomaly_detectors
curl \
 -X GET http://api.example.com/_ml/anomaly_detectors
Response examples (200)
{
  "count": 42.0,
  "jobs": [
    {
      "allow_lazy_open": true,
      "analysis_config": {
        "bucket_span": "string",
        "": "string",
        "categorization_field_name": "string",
        "categorization_filters": [
          "string"
        ],
        "detectors": [
          {
            "by_field_name": "string",
            "custom_rules": [
              {}
            ],
            "detector_description": "string",
            "detector_index": 42.0,
            "exclude_frequent": "all",
            "field_name": "string",
            "function": "string",
            "over_field_name": "string",
            "partition_field_name": "string",
            "use_null": true
          }
        ],
        "influencers": [
          "string"
        ],
        "latency": "string",
        "model_prune_window": "string",
        "multivariate_by_fields": true,
        "per_partition_categorization": {
          "enabled": true,
          "stop_on_warn": true
        },
        "summary_count_field_name": "string"
      },
      "analysis_limits": {
        "categorization_examples_limit": 42.0,
        "": 42.0
      },
      "background_persist_interval": "string",
      "blocked": {
        "reason": "delete",
        "": "string"
      },
      "": "string",
      "custom_settings": {},
      "daily_model_snapshot_retention_after_days": 42.0,
      "data_description": {
        "format": "string",
        "time_field": "string",
        "time_format": "string",
        "field_delimiter": "string"
      },
      "datafeed_config": {
        "aggregations": {},
        "authorization": {
          "api_key": {
            "id": "string",
            "name": "string"
          },
          "roles": [
            "string"
          ],
          "service_account": "string"
        },
        "chunking_config": {
          "mode": "auto",
          "time_span": "string"
        },
        "datafeed_id": "string",
        "frequency": "string",
        "indices": [
          "string"
        ],
        "indexes": [
          "string"
        ],
        "job_id": "string",
        "max_empty_searches": 42.0,
        "query_delay": "string",
        "script_fields": {
          "additionalProperty1": {
            "script": {},
            "ignore_failure": true
          },
          "additionalProperty2": {
            "script": {},
            "ignore_failure": true
          }
        },
        "scroll_size": 42.0,
        "delayed_data_check_config": {
          "check_window": "string",
          "enabled": true
        },
        "runtime_mappings": {
          "additionalProperty1": {
            "fields": {},
            "fetch_fields": [
              {}
            ],
            "format": "string",
            "input_field": "string",
            "target_field": "string",
            "target_index": "string",
            "script": {},
            "type": "boolean"
          },
          "additionalProperty2": {
            "fields": {},
            "fetch_fields": [
              {}
            ],
            "format": "string",
            "input_field": "string",
            "target_field": "string",
            "target_index": "string",
            "script": {},
            "type": "boolean"
          }
        },
        "indices_options": {
          "allow_no_indices": true,
          "expand_wildcards": "string",
          "ignore_unavailable": true,
          "ignore_throttled": true
        },
        "query": {}
      },
      "deleting": true,
      "description": "string",
      "groups": [
        "string"
      ],
      "job_id": "string",
      "job_type": "string",
      "job_version": "string",
      "model_plot_config": {
        "annotations_enabled": true,
        "enabled": true,
        "terms": "string"
      },
      "model_snapshot_id": "string",
      "model_snapshot_retention_days": 42.0,
      "renormalization_window_days": 42.0,
      "results_index_name": "string",
      "results_retention_days": 42.0
    }
  ]
}




























Open anomaly detection jobs Added in 5.4.0

POST /_ml/anomaly_detectors/{job_id}/_open

An anomaly detection job must be opened to be ready to receive and analyze data. It can be opened and closed multiple times throughout its lifecycle. When you open a new job, it starts with an empty model. When you open an existing job, the most recent model state is automatically loaded. The job is ready to resume its analysis from where it left off, once new data is received.

Path parameters

  • job_id string Required

    Identifier for the anomaly detection job.

Query parameters

  • timeout string

    Controls the time to wait until a job has opened.

application/json

Body

  • timeout string

    A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
POST /_ml/anomaly_detectors/{job_id}/_open
curl \
 -X POST http://api.example.com/_ml/anomaly_detectors/{job_id}/_open \
 -H "Content-Type: application/json" \
 -d '{"timeout":"string"}'
Request examples
{
  "timeout": "string"
}
Response examples (200)
{
  "opened": true,
  "node": "string"
}









































































































Get data frame analytics jobs usage info Added in 7.3.0

GET /_ml/data_frame/analytics/{id}/_stats

Path parameters

  • id string Required

    Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame analytics jobs.

Query parameters

  • Specifies what to do when the request:

    1. Contains wildcard expressions and there are no data frame analytics jobs that match.
    2. Contains the _all string or no identifiers and there are no matches.
    3. Contains wildcard expressions and there are only partial matches.

    The default value returns an empty data_frame_analytics array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.

  • from number

    Skips the specified number of data frame analytics jobs.

  • size number

    Specifies the maximum number of data frame analytics jobs to obtain.

  • verbose boolean

    Defines whether the stats response should be verbose.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • count number Required
    • data_frame_analytics array[object] Required

      An array of objects that contain usage information for data frame analytics jobs, which are sorted by the id value in ascending order.

      Hide data_frame_analytics attributes Show data_frame_analytics attributes object
      • Additional properties are allowed.

        Hide analysis_stats attributes Show analysis_stats attributes object
        • Additional properties are allowed.

          Hide classification_stats attributes Show classification_stats attributes object
          • hyperparameters object Required

            Additional properties are allowed.

            Hide hyperparameters attributes Show hyperparameters attributes object
            • alpha number

              Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero.

            • lambda number

              Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.

            • gamma number

              Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.

            • eta number

              Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1.

            • Advanced configuration option. Specifies the rate at which eta increases for each new tree that is added to the forest. For example, a rate of 1.05 increases eta by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2.

            • Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization.

            • Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1.

            • If the algorithm fails to determine a non-trivial tree (more than a single leaf), this parameter determines how many of such consecutive failures are tolerated. Once the number of attempts exceeds the threshold, the forest training stops.

            • Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization.

            • Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization.

            • The maximum number of folds for the cross-validation procedure.

            • Determines the maximum number of splits for every feature that can occur in a decision tree when the tree is trained.

            • Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the soft_tree_depth_tolerance to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.

            • Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds soft_tree_depth_limit. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01.

          • iteration number Required

            The number of iterations on the analysis.

          • Time unit for milliseconds

          • timing_stats object Required

            Additional properties are allowed.

            Hide timing_stats attributes Show timing_stats attributes object
          • validation_loss object Required

            Additional properties are allowed.

            Hide validation_loss attributes Show validation_loss attributes object
            • fold_values array[string] Required

              Validation loss values for every added decision tree during the forest growing procedure.

            • loss_type string Required

              The type of the loss metric. For example, binomial_logistic.

        • Additional properties are allowed.

          Hide outlier_detection_stats attributes Show outlier_detection_stats attributes object
          • parameters object Required

            Additional properties are allowed.

            Hide parameters attributes Show parameters attributes object
            • Specifies whether the feature influence calculation is enabled.

            • The minimum outlier score that a document needs to have in order to calculate its feature influence score. Value range: 0-1

            • method string

              The method that outlier detection uses. Available methods are lof, ldof, distance_kth_nn, distance_knn, and ensemble. The default value is ensemble, which means that outlier detection uses an ensemble of different methods and normalises and combines their individual outlier scores to obtain the overall outlier score.

            • Defines the value for how many nearest neighbors each method of outlier detection uses to calculate its outlier score. When the value is not set, different values are used for different ensemble members. This default behavior helps improve the diversity in the ensemble; only override it if you are confident that the value you choose is appropriate for the data set.

            • The proportion of the data set that is assumed to be outlying prior to outlier detection. For example, 0.05 means it is assumed that 5% of values are real outliers and 95% are inliers.

            • If true, the following operation is performed on the columns before computing outlier scores: (x_i - mean(x_i)) / sd(x_i).

          • Time unit for milliseconds

          • timing_stats object Required

            Additional properties are allowed.

            Hide timing_stats attributes Show timing_stats attributes object
        • Additional properties are allowed.

          Hide regression_stats attributes Show regression_stats attributes object
          • hyperparameters object Required

            Additional properties are allowed.

            Hide hyperparameters attributes Show hyperparameters attributes object
            • alpha number

              Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero.

            • lambda number

              Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.

            • gamma number

              Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.

            • eta number

              Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1.

            • Advanced configuration option. Specifies the rate at which eta increases for each new tree that is added to the forest. For example, a rate of 1.05 increases eta by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2.

            • Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization.

            • Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1.

            • If the algorithm fails to determine a non-trivial tree (more than a single leaf), this parameter determines how many of such consecutive failures are tolerated. Once the number of attempts exceeds the threshold, the forest training stops.

            • Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization.

            • Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization.

            • The maximum number of folds for the cross-validation procedure.

            • Determines the maximum number of splits for every feature that can occur in a decision tree when the tree is trained.

            • Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the soft_tree_depth_tolerance to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.

            • Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds soft_tree_depth_limit. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01.

          • iteration number Required

            The number of iterations on the analysis.

          • Time unit for milliseconds

          • timing_stats object Required

            Additional properties are allowed.

            Hide timing_stats attributes Show timing_stats attributes object
          • validation_loss object Required

            Additional properties are allowed.

            Hide validation_loss attributes Show validation_loss attributes object
            • fold_values array[string] Required

              Validation loss values for every added decision tree during the forest growing procedure.

            • loss_type string Required

              The type of the loss metric. For example, binomial_logistic.

      • For running jobs only, contains messages relating to the selection of a node to run the job.

      • data_counts object Required

        Additional properties are allowed.

        Hide data_counts attributes Show data_counts attributes object
        • skipped_docs_count number Required

          The number of documents that are skipped during the analysis because they contained values that are not supported by the analysis. For example, outlier detection does not support missing fields so it skips documents with missing fields. Likewise, all types of analysis skip documents that contain arrays with more than one element.

        • test_docs_count number Required

          The number of documents that are not used for training the model and can be used for testing.

        • training_docs_count number Required

          The number of documents that are used for training the model.

      • id string Required
      • memory_usage object Required

        Additional properties are allowed.

        Hide memory_usage attributes Show memory_usage attributes object
        • This value is present when the status is hard_limit and it is a new estimate of how much memory the job needs.

        • peak_usage_bytes number Required

          The number of bytes used at the highest peak of memory usage.

        • status string Required

          The memory usage status.

        • Time unit for milliseconds

      • node object

        Additional properties are allowed.

        Hide node attributes Show node attributes object
      • progress array[object] Required

        The progress report of the data frame analytics job by phase.

        Hide progress attributes Show progress attributes object
        • phase string Required

          Defines the phase of the data frame analytics job.

        • progress_percent number Required

          The progress that the data frame analytics job has made expressed in percentage.

      • state string Required

        Values are started, stopped, starting, stopping, or failed.

GET /_ml/data_frame/analytics/{id}/_stats
curl \
 -X GET http://api.example.com/_ml/data_frame/analytics/{id}/_stats
Response examples (200)
{
  "count": 42.0,
  "data_frame_analytics": [
    {
      "analysis_stats": {
        "classification_stats": {
          "hyperparameters": {
            "alpha": 42.0,
            "lambda": 42.0,
            "gamma": 42.0,
            "eta": 42.0,
            "eta_growth_rate_per_tree": 42.0,
            "feature_bag_fraction": 42.0,
            "downsample_factor": 42.0,
            "max_attempts_to_add_tree": 42.0,
            "max_optimization_rounds_per_hyperparameter": 42.0,
            "max_trees": 42.0,
            "num_folds": 42.0,
            "num_splits_per_feature": 42.0,
            "soft_tree_depth_limit": 42.0,
            "soft_tree_depth_tolerance": 42.0
          },
          "iteration": 42.0,
          "": 42.0,
          "timing_stats": {},
          "validation_loss": {
            "fold_values": [
              "string"
            ],
            "loss_type": "string"
          }
        },
        "outlier_detection_stats": {
          "parameters": {
            "compute_feature_influence": true,
            "feature_influence_threshold": 42.0,
            "method": "string",
            "n_neighbors": 42.0,
            "outlier_fraction": 42.0,
            "standardization_enabled": true
          },
          "": 42.0,
          "timing_stats": {}
        },
        "regression_stats": {
          "hyperparameters": {
            "alpha": 42.0,
            "lambda": 42.0,
            "gamma": 42.0,
            "eta": 42.0,
            "eta_growth_rate_per_tree": 42.0,
            "feature_bag_fraction": 42.0,
            "downsample_factor": 42.0,
            "max_attempts_to_add_tree": 42.0,
            "max_optimization_rounds_per_hyperparameter": 42.0,
            "max_trees": 42.0,
            "num_folds": 42.0,
            "num_splits_per_feature": 42.0,
            "soft_tree_depth_limit": 42.0,
            "soft_tree_depth_tolerance": 42.0
          },
          "iteration": 42.0,
          "": 42.0,
          "timing_stats": {},
          "validation_loss": {
            "fold_values": [
              "string"
            ],
            "loss_type": "string"
          }
        }
      },
      "assignment_explanation": "string",
      "data_counts": {
        "skipped_docs_count": 42.0,
        "test_docs_count": 42.0,
        "training_docs_count": 42.0
      },
      "id": "string",
      "memory_usage": {
        "memory_reestimate_bytes": 42.0,
        "peak_usage_bytes": 42.0,
        "status": "string",
        "": 42.0
      },
      "node": {
        "attributes": {
          "additionalProperty1": "string",
          "additionalProperty2": "string"
        },
        "ephemeral_id": "string",
        "id": "string",
        "name": "string",
        "transport_address": "string"
      },
      "progress": [
        {
          "phase": "string",
          "progress_percent": 42.0
        }
      ],
      "state": "started"
    }
  ]
}




Preview features used by data frame analytics Added in 7.13.0

POST /_ml/data_frame/analytics/_preview

Previews the extracted features used by a data frame analytics config.

application/json

Body

  • config object

    Additional properties are allowed.

    Hide config attributes Show config attributes object
    • source object Required

      Additional properties are allowed.

      Hide source attributes Show source attributes object
      • index string | array[string] Required
      • Hide runtime_mappings attribute Show runtime_mappings attribute object
        • * object Additional properties

          Additional properties are allowed.

          Hide * attributes Show * attributes object
          • fields object

            For type composite

            Hide fields attribute Show fields attribute object
            • * object Additional properties

              Additional properties are allowed.

              Hide * attribute Show * attribute object
              • type string Required

                Values are boolean, composite, date, double, geo_point, ip, keyword, long, or lookup.

          • fetch_fields array[object]

            For type lookup

            Hide fetch_fields attributes Show fetch_fields attributes object
            • field string Required

              Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

            • format string
          • format string

            A custom format for date type runtime fields.

          • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

          • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

          • script object

            Additional properties are allowed.

            Hide script attributes Show script attributes object
            • source string

              The script source.

            • id string
            • params object

              Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time.

              Hide params attribute Show params attribute object
              • * object Additional properties

                Additional properties are allowed.

            • lang string

              Any of:

              Values are painless, expression, mustache, or java.

            • options object
              Hide options attribute Show options attribute object
              • * string Additional properties
          • type string Required

            Values are boolean, composite, date, double, geo_point, ip, keyword, long, or lookup.

      • _source object

        Additional properties are allowed.

        Hide _source attributes Show _source attributes object
        • includes array[string] Required

          An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically.

        • excludes array[string] Required

          An array of strings that defines the fields that will be included in the analysis.

      • query object

        The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. By default, this property has the following value: {"match_all": {}}.

        Additional properties are allowed.

    • analysis object Required

      Additional properties are allowed.

      Hide analysis attributes Show analysis attributes object
      • Additional properties are allowed.

        Hide classification attributes Show classification attributes object
        • alpha number

          Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero.

        • dependent_variable string Required

          Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable. For classification analysis, the data type of the field must be numeric (integer, short, long, byte), categorical (ip or keyword), or boolean. There must be no more than 30 different values in this field. For regression analysis, the data type of the field must be numeric.

        • Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1.

        • Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable.

        • eta number

          Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1.

        • Advanced configuration option. Specifies the rate at which eta increases for each new tree that is added to the forest. For example, a rate of 1.05 increases eta by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2.

        • Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization.

        • feature_processors array[object]

          Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple feature_processors entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields.

          Hide feature_processors attributes Show feature_processors attributes object
        • gamma number

          Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.

        • lambda number

          Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.

        • Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization.

        • Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization.

        • Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs.

        • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

        • Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as source and analyzed_fields are the same).

        • Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the soft_tree_depth_tolerance to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.

        • Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds soft_tree_depth_limit. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01.

        • Defines the number of categories for which the predicted probabilities are reported. It must be non-negative or -1. If it is -1 or greater than the total number of categories, probabilities are reported for all categories; if you have a large number of categories, there could be a significant effect on the size of your destination index. NOTE: To use the AUC ROC evaluation method, num_top_classes must be set to -1 or a value greater than or equal to the total number of categories.

      • Additional properties are allowed.

        Hide outlier_detection attributes Show outlier_detection attributes object
        • Specifies whether the feature influence calculation is enabled.

        • The minimum outlier score that a document needs to have in order to calculate its feature influence score. Value range: 0-1.

        • method string

          The method that outlier detection uses. Available methods are lof, ldof, distance_kth_nn, distance_knn, and ensemble. The default value is ensemble, which means that outlier detection uses an ensemble of different methods and normalises and combines their individual outlier scores to obtain the overall outlier score.

        • Defines the value for how many nearest neighbors each method of outlier detection uses to calculate its outlier score. When the value is not set, different values are used for different ensemble members. This default behavior helps improve the diversity in the ensemble; only override it if you are confident that the value you choose is appropriate for the data set.

        • The proportion of the data set that is assumed to be outlying prior to outlier detection. For example, 0.05 means it is assumed that 5% of values are real outliers and 95% are inliers.

        • If true, the following operation is performed on the columns before computing outlier scores: (x_i - mean(x_i)) / sd(x_i).

      • Additional properties are allowed.

        Hide regression attributes Show regression attributes object
        • alpha number

          Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero.

        • dependent_variable string Required

          Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable. For classification analysis, the data type of the field must be numeric (integer, short, long, byte), categorical (ip or keyword), or boolean. There must be no more than 30 different values in this field. For regression analysis, the data type of the field must be numeric.

        • Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1.

        • Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable.

        • eta number

          Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1.

        • Advanced configuration option. Specifies the rate at which eta increases for each new tree that is added to the forest. For example, a rate of 1.05 increases eta by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2.

        • Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization.

        • feature_processors array[object]

          Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple feature_processors entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields.

          Hide feature_processors attributes Show feature_processors attributes object
        • gamma number

          Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.

        • lambda number

          Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.

        • Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization.

        • Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization.

        • Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs.

        • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

        • Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as source and analyzed_fields are the same).

        • Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the soft_tree_depth_tolerance to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.

        • Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds soft_tree_depth_limit. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01.

        • The loss function used during regression. Available options are mse (mean squared error), msle (mean squared logarithmic error), huber (Pseudo-Huber loss).

        • A positive number that is used as a parameter to the loss_function.

    • Additional properties are allowed.

      Hide analyzed_fields attributes Show analyzed_fields attributes object
      • includes array[string] Required

        An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically.

      • excludes array[string] Required

        An array of strings that defines the fields that will be included in the analysis.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • feature_values array[object] Required

      An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training.

      Hide feature_values attribute Show feature_values attribute object
      • * string Additional properties
POST /_ml/data_frame/analytics/_preview
curl \
 -X POST http://api.example.com/_ml/data_frame/analytics/_preview \
 -H "Content-Type: application/json" \
 -d '{"config":{"source":{"index":"string","runtime_mappings":{"additionalProperty1":{"fields":{"additionalProperty1":{"type":"boolean"},"additionalProperty2":{"type":"boolean"}},"fetch_fields":[{"field":"string","format":"string"}],"format":"string","input_field":"string","target_field":"string","target_index":"string","script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"type":"boolean"},"additionalProperty2":{"fields":{"additionalProperty1":{"type":"boolean"},"additionalProperty2":{"type":"boolean"}},"fetch_fields":[{"field":"string","format":"string"}],"format":"string","input_field":"string","target_field":"string","target_index":"string","script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"type":"boolean"}},"_source":{"includes":["string"],"excludes":["string"]},"query":{}},"analysis":{"":{"alpha":42.0,"dependent_variable":"string","downsample_factor":42.0,"early_stopping_enabled":true,"eta":42.0,"eta_growth_rate_per_tree":42.0,"feature_bag_fraction":42.0,"feature_processors":[{"frequency_encoding":{},"multi_encoding":{},"n_gram_encoding":{},"one_hot_encoding":{},"target_mean_encoding":{}}],"gamma":42.0,"lambda":42.0,"max_optimization_rounds_per_hyperparameter":42.0,"max_trees":42.0,"num_top_feature_importance_values":42.0,"prediction_field_name":"string","randomize_seed":42.0,"soft_tree_depth_limit":42.0,"soft_tree_depth_tolerance":42.0,"":"string","loss_function":"string","loss_function_parameter":42.0},"outlier_detection":{"compute_feature_influence":true,"feature_influence_threshold":42.0,"method":"string","n_neighbors":42.0,"outlier_fraction":42.0,"standardization_enabled":true}},"model_memory_limit":"string","max_num_threads":42.0,"analyzed_fields":{"includes":["string"],"excludes":["string"]}}}'
Request examples
{
  "config": {
    "source": {
      "index": "string",
      "runtime_mappings": {
        "additionalProperty1": {
          "fields": {
            "additionalProperty1": {
              "type": "boolean"
            },
            "additionalProperty2": {
              "type": "boolean"
            }
          },
          "fetch_fields": [
            {
              "field": "string",
              "format": "string"
            }
          ],
          "format": "string",
          "input_field": "string",
          "target_field": "string",
          "target_index": "string",
          "script": {
            "source": "string",
            "id": "string",
            "params": {
              "additionalProperty1": {},
              "additionalProperty2": {}
            },
            "": "painless",
            "options": {
              "additionalProperty1": "string",
              "additionalProperty2": "string"
            }
          },
          "type": "boolean"
        },
        "additionalProperty2": {
          "fields": {
            "additionalProperty1": {
              "type": "boolean"
            },
            "additionalProperty2": {
              "type": "boolean"
            }
          },
          "fetch_fields": [
            {
              "field": "string",
              "format": "string"
            }
          ],
          "format": "string",
          "input_field": "string",
          "target_field": "string",
          "target_index": "string",
          "script": {
            "source": "string",
            "id": "string",
            "params": {
              "additionalProperty1": {},
              "additionalProperty2": {}
            },
            "": "painless",
            "options": {
              "additionalProperty1": "string",
              "additionalProperty2": "string"
            }
          },
          "type": "boolean"
        }
      },
      "_source": {
        "includes": [
          "string"
        ],
        "excludes": [
          "string"
        ]
      },
      "query": {}
    },
    "analysis": {
      "": {
        "alpha": 42.0,
        "dependent_variable": "string",
        "downsample_factor": 42.0,
        "early_stopping_enabled": true,
        "eta": 42.0,
        "eta_growth_rate_per_tree": 42.0,
        "feature_bag_fraction": 42.0,
        "feature_processors": [
          {
            "frequency_encoding": {},
            "multi_encoding": {},
            "n_gram_encoding": {},
            "one_hot_encoding": {},
            "target_mean_encoding": {}
          }
        ],
        "gamma": 42.0,
        "lambda": 42.0,
        "max_optimization_rounds_per_hyperparameter": 42.0,
        "max_trees": 42.0,
        "num_top_feature_importance_values": 42.0,
        "prediction_field_name": "string",
        "randomize_seed": 42.0,
        "soft_tree_depth_limit": 42.0,
        "soft_tree_depth_tolerance": 42.0,
        "": "string",
        "loss_function": "string",
        "loss_function_parameter": 42.0
      },
      "outlier_detection": {
        "compute_feature_influence": true,
        "feature_influence_threshold": 42.0,
        "method": "string",
        "n_neighbors": 42.0,
        "outlier_fraction": 42.0,
        "standardization_enabled": true
      }
    },
    "model_memory_limit": "string",
    "max_num_threads": 42.0,
    "analyzed_fields": {
      "includes": [
        "string"
      ],
      "excludes": [
        "string"
      ]
    }
  }
}
Response examples (200)
{
  "feature_values": [
    {
      "additionalProperty1": "string",
      "additionalProperty2": "string"
    }
  ]
}









































Delete a trained model alias Added in 7.13.0

DELETE /_ml/trained_models/{model_id}/model_aliases/{model_alias}

This API deletes an existing model alias that refers to a trained model. If the model alias is missing or refers to a model other than the one identified by the model_id, this API returns an error.

Path parameters

  • model_id string Required

    The trained model ID to which the model alias refers.

  • model_alias string Required

    The model alias to delete.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • acknowledged boolean Required

      For a successful response, this value is always true. On failure, an exception is returned instead.

DELETE /_ml/trained_models/{model_id}/model_aliases/{model_alias}
curl \
 -X DELETE http://api.example.com/_ml/trained_models/{model_id}/model_aliases/{model_alias}
Response examples (200)
{
  "acknowledged": true
}




Get trained models usage info Added in 7.10.0

GET /_ml/trained_models/{model_id}/_stats

You can get usage information for multiple trained models in a single API request by using a comma-separated list of model IDs or a wildcard expression.

Path parameters

  • model_id string | array[string] Required

    The unique identifier of the trained model or a model alias. It can be a comma-separated list or a wildcard expression.

Query parameters

  • Specifies what to do when the request:

    • Contains wildcard expressions and there are no models that match.
    • Contains the _all string or no identifiers and there are no matches.
    • Contains wildcard expressions and there are only partial matches.

    If true, it returns an empty array when there are no matches and the subset of results when there are partial matches.

  • from number

    Skips the specified number of models.

  • size number

    Specifies the maximum number of models to obtain.

Responses

GET /_ml/trained_models/{model_id}/_stats
curl \
 -X GET http://api.example.com/_ml/trained_models/{model_id}/_stats
Response examples (200)
{
  "count": 42.0,
  "trained_model_stats": [
    {
      "deployment_stats": {
        "adaptive_allocations": {
          "enabled": true,
          "min_number_of_allocations": 42.0,
          "max_number_of_allocations": 42.0
        },
        "allocation_status": {
          "allocation_count": 42.0,
          "state": "started",
          "target_allocation_count": 42.0
        },
        "": 42.0,
        "deployment_id": "string",
        "error_count": 42.0,
        "inference_count": 42.0,
        "model_id": "string",
        "nodes": [
          {
            "error_count": 42.0,
            "inference_count": 42.0,
            "inference_cache_hit_count": 42.0,
            "inference_cache_hit_count_last_minute": 42.0,
            "node": {},
            "number_of_allocations": 42.0,
            "number_of_pending_requests": 42.0,
            "peak_throughput_per_minute": 42.0,
            "rejection_execution_count": 42.0,
            "routing_state": {},
            "threads_per_allocation": 42.0,
            "throughput_last_minute": 42.0,
            "timeout_count": 42.0
          }
        ],
        "number_of_allocations": 42.0,
        "peak_throughput_per_minute": 42.0,
        "priority": "normal",
        "queue_capacity": 42.0,
        "rejected_execution_count": 42.0,
        "reason": "string",
        "state": "started",
        "threads_per_allocation": 42.0,
        "timeout_count": 42.0
      },
      "inference_stats": {
        "cache_miss_count": 42.0,
        "failure_count": 42.0,
        "inference_count": 42.0,
        "missing_all_fields_count": 42.0,
        "": 42.0
      },
      "ingest": {
        "additionalProperty1": {},
        "additionalProperty2": {}
      },
      "model_id": "string",
      "model_size_stats": {
        "": 42.0
      },
      "pipeline_count": 42.0
    }
  ]
}








Evaluate a trained model Added in 8.3.0

POST /_ml/trained_models/{model_id}/deployment/_infer

Path parameters

  • model_id string Required

    The unique identifier of the trained model.

Query parameters

  • timeout string

    Controls the amount of time to wait for inference results.

application/json

Body Required

  • docs array[object] Required

    An array of objects to pass to the model for inference. The objects should contain a fields matching your configured trained model input. Typically, for NLP models, the field name is text_field. Currently, for NLP models, only a single value is allowed.

    Hide docs attribute Show docs attribute object
    • * object Additional properties

      Additional properties are allowed.

  • Additional properties are allowed.

    Hide inference_config attributes Show inference_config attributes object
    • Additional properties are allowed.

      Hide regression attributes Show regression attributes object
    • Additional properties are allowed.

      Hide classification attributes Show classification attributes object
      • Specifies the number of top class predictions to return. Defaults to 0.

      • Specifies the maximum number of feature importance values per document.

      • Specifies the type of the predicted field to write. Acceptable values are: string, number, boolean. When boolean is provided 1.0 is transformed to true and 0.0 to false.

      • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

      • Specifies the field to which the top classes are written. Defaults to top_classes.

    • Additional properties are allowed.

      Hide text_classification attributes Show text_classification attributes object
      • Specifies the number of top class predictions to return. Defaults to 0.

      • Additional properties are allowed.

        Hide tokenization attributes Show tokenization attributes object
        • truncate string

          Values are first, second, or none.

        • span number

          Span options to apply

      • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

      • Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels

    • Additional properties are allowed.

      Hide zero_shot_classification attributes Show zero_shot_classification attributes object
      • Additional properties are allowed.

        Hide tokenization attributes Show tokenization attributes object
        • truncate string

          Values are first, second, or none.

        • span number

          Span options to apply

      • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

      • Update the configured multi label option. Indicates if more than one true label exists. Defaults to the configured value.

      • labels array[string] Required

        The labels to predict.

    • Additional properties are allowed.

      Hide fill_mask attributes Show fill_mask attributes object
      • Specifies the number of top class predictions to return. Defaults to 0.

      • Additional properties are allowed.

        Hide tokenization attributes Show tokenization attributes object
        • truncate string

          Values are first, second, or none.

        • span number

          Span options to apply

      • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

    • ner object

      Additional properties are allowed.

      Hide ner attributes Show ner attributes object
      • Additional properties are allowed.

        Hide tokenization attributes Show tokenization attributes object
        • truncate string

          Values are first, second, or none.

        • span number

          Span options to apply

      • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

    • Additional properties are allowed.

      Hide pass_through attributes Show pass_through attributes object
      • Additional properties are allowed.

        Hide tokenization attributes Show tokenization attributes object
        • truncate string

          Values are first, second, or none.

        • span number

          Span options to apply

      • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

    • Additional properties are allowed.

      Hide text_embedding attributes Show text_embedding attributes object
      • Additional properties are allowed.

        Hide tokenization attributes Show tokenization attributes object
        • truncate string

          Values are first, second, or none.

        • span number

          Span options to apply

      • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

    • Additional properties are allowed.

      Hide text_expansion attributes Show text_expansion attributes object
      • Additional properties are allowed.

        Hide tokenization attributes Show tokenization attributes object
        • truncate string

          Values are first, second, or none.

        • span number

          Span options to apply

      • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

    • Additional properties are allowed.

      Hide question_answering attributes Show question_answering attributes object
      • question string Required

        The question to answer given the inference context

      • Specifies the number of top class predictions to return. Defaults to 0.

      • Additional properties are allowed.

        Hide tokenization attributes Show tokenization attributes object
        • truncate string

          Values are first, second, or none.

        • span number

          Span options to apply

      • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

      • The maximum answer length to consider for extraction

Responses

POST /_ml/trained_models/{model_id}/deployment/_infer
curl \
 -X POST http://api.example.com/_ml/trained_models/{model_id}/deployment/_infer \
 -H "Content-Type: application/json" \
 -d '{"docs":[{"additionalProperty1":{},"additionalProperty2":{}}],"inference_config":{"regression":{"results_field":"string","num_top_feature_importance_values":42.0},"classification":{"num_top_classes":42.0,"num_top_feature_importance_values":42.0,"prediction_field_type":"string","results_field":"string","top_classes_results_field":"string"},"text_classification":{"num_top_classes":42.0,"tokenization":{"truncate":"first","span":42.0},"results_field":"string","classification_labels":["string"]},"zero_shot_classification":{"tokenization":{"truncate":"first","span":42.0},"results_field":"string","multi_label":true,"labels":["string"]},"fill_mask":{"num_top_classes":42.0,"tokenization":{"truncate":"first","span":42.0},"results_field":"string"},"ner":{"tokenization":{"truncate":"first","span":42.0},"results_field":"string"},"pass_through":{"tokenization":{"truncate":"first","span":42.0},"results_field":"string"},"text_embedding":{"tokenization":{"truncate":"first","span":42.0},"results_field":"string"},"text_expansion":{"tokenization":{"truncate":"first","span":42.0},"results_field":"string"},"question_answering":{"question":"string","num_top_classes":42.0,"tokenization":{"truncate":"first","span":42.0},"results_field":"string","max_answer_length":42.0}}}'
Request examples
{
  "docs": [
    {
      "additionalProperty1": {},
      "additionalProperty2": {}
    }
  ],
  "inference_config": {
    "regression": {
      "results_field": "string",
      "num_top_feature_importance_values": 42.0
    },
    "classification": {
      "num_top_classes": 42.0,
      "num_top_feature_importance_values": 42.0,
      "prediction_field_type": "string",
      "results_field": "string",
      "top_classes_results_field": "string"
    },
    "text_classification": {
      "num_top_classes": 42.0,
      "tokenization": {
        "truncate": "first",
        "span": 42.0
      },
      "results_field": "string",
      "classification_labels": [
        "string"
      ]
    },
    "zero_shot_classification": {
      "tokenization": {
        "truncate": "first",
        "span": 42.0
      },
      "results_field": "string",
      "multi_label": true,
      "labels": [
        "string"
      ]
    },
    "fill_mask": {
      "num_top_classes": 42.0,
      "tokenization": {
        "truncate": "first",
        "span": 42.0
      },
      "results_field": "string"
    },
    "ner": {
      "tokenization": {
        "truncate": "first",
        "span": 42.0
      },
      "results_field": "string"
    },
    "pass_through": {
      "tokenization": {
        "truncate": "first",
        "span": 42.0
      },
      "results_field": "string"
    },
    "text_embedding": {
      "tokenization": {
        "truncate": "first",
        "span": 42.0
      },
      "results_field": "string"
    },
    "text_expansion": {
      "tokenization": {
        "truncate": "first",
        "span": 42.0
      },
      "results_field": "string"
    },
    "question_answering": {
      "question": "string",
      "num_top_classes": 42.0,
      "tokenization": {
        "truncate": "first",
        "span": 42.0
      },
      "results_field": "string",
      "max_answer_length": 42.0
    }
  }
}
Response examples (200)
{
  "inference_results": [
    {
      "entities": [
        {
          "class_name": "string",
          "class_probability": 42.0,
          "entity": "string",
          "start_pos": 42.0,
          "end_pos": 42.0
        }
      ],
      "is_truncated": true,
      "": 42.0,
      "predicted_value_sequence": "string",
      "prediction_probability": 42.0,
      "prediction_score": 42.0,
      "top_classes": [
        {
          "class_name": "string",
          "class_probability": 42.0,
          "class_score": 42.0
        }
      ],
      "warning": "string",
      "feature_importance": [
        {
          "feature_name": "string",
          "importance": 42.0,
          "classes": [
            {}
          ]
        }
      ]
    }
  ]
}










































Send monitoring data Added in 6.3.0

POST /_monitoring/bulk

This API is used by the monitoring features to send monitoring data.

Query parameters

application/json

Body object Required

One of:
  • index object

    Additional properties are allowed.

    Hide index attributes Show index attributes object
    • _id string
    • _index string
    • routing string
    • version number
    • Values are internal, external, external_gte, or force.

    • A map from the full name of fields to the name of dynamic templates. It defaults to an empty map. If a name matches a dynamic template, that template will be applied regardless of other match predicates defined in the template. If a field is already defined in the mapping, then this parameter won't be used.

      Hide dynamic_templates attribute Show dynamic_templates attribute object
      • * string Additional properties
    • pipeline string

      The ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, setting the value to _none turns off the default ingest pipeline for this request. If a final pipeline is configured, it will always run regardless of the value of this parameter.

    • If true, the request's actions must target an index alias.

  • create object

    Additional properties are allowed.

    Hide create attributes Show create attributes object
    • _id string
    • _index string
    • routing string
    • version number
    • Values are internal, external, external_gte, or force.

    • A map from the full name of fields to the name of dynamic templates. It defaults to an empty map. If a name matches a dynamic template, that template will be applied regardless of other match predicates defined in the template. If a field is already defined in the mapping, then this parameter won't be used.

      Hide dynamic_templates attribute Show dynamic_templates attribute object
      • * string Additional properties
    • pipeline string

      The ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, setting the value to _none turns off the default ingest pipeline for this request. If a final pipeline is configured, it will always run regardless of the value of this parameter.

    • If true, the request's actions must target an index alias.

  • update object

    Additional properties are allowed.

    Hide update attributes Show update attributes object
  • delete object

    Additional properties are allowed.

    Hide delete attributes Show delete attributes object

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • error object

      Additional properties are allowed.

      Hide error attributes Show error attributes object
      • type string Required

        The type of error

      • reason string

        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.

      • Additional properties are allowed.

      • root_cause array[object]

        Additional properties are allowed.

      • suppressed array[object]

        Additional properties are allowed.

    • errors boolean Required

      True if there is was an error

    • ignored boolean Required

      Was collection disabled?

    • took number Required
POST /_monitoring/bulk
curl \
 -X POST http://api.example.com/_monitoring/bulk?system_id=string&system_api_version=string&interval=string \
 -H "Content-Type: application/json" \
 -d '[{"":{"_id":"string","_index":"string","routing":"string","if_primary_term":42.0,"if_seq_no":42.0,"version":42.0,"version_type":"internal"}}]'
Request examples
[
  {
    "": {
      "_id": "string",
      "_index": "string",
      "routing": "string",
      "if_primary_term": 42.0,
      "if_seq_no": 42.0,
      "version": 42.0,
      "version_type": "internal"
    }
  }
]
Response examples (200)
{
  "error": {
    "type": "string",
    "reason": "string",
    "stack_trace": "string",
    "caused_by": {},
    "root_cause": [
      {}
    ],
    "suppressed": [
      {}
    ]
  },
  "errors": true,
  "ignored": true,
  "took": 42.0
}


































Delete a query rule Added in 8.15.0

DELETE /_query_rules/{ruleset_id}/_rule/{rule_id}

Delete a query rule within a query ruleset. This is a destructive action that is only recoverable by re-adding the same rule with the create or update query rule API.

Path parameters

  • ruleset_id string Required

    The unique identifier of the query ruleset containing the rule to delete

  • rule_id string Required

    The unique identifier of the query rule within the specified ruleset to delete

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • acknowledged boolean Required

      For a successful response, this value is always true. On failure, an exception is returned instead.

DELETE /_query_rules/{ruleset_id}/_rule/{rule_id}
curl \
 -X DELETE http://api.example.com/_query_rules/{ruleset_id}/_rule/{rule_id}
Response examples (200)
{
  "acknowledged": true
}















































































































































Run a scrolling search

POST /_search/scroll/{scroll_id}

IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the search_after parameter with a point in time (PIT).

The scroll API gets large sets of results from a single scrolling search request. To get the necessary scroll ID, submit a search API request that includes an argument for the scroll query parameter. The scroll parameter indicates how long Elasticsearch should retain the search context for the request. The search response returns a scroll ID in the _scroll_id response body parameter. You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request. If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search.

You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context.

IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests.

Path parameters

Query parameters

  • scroll string

    Period to retain the search context for scrolling.

  • scroll_id string Deprecated

    The scroll ID for scrolled search

  • If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.

application/json

Body

  • scroll string

    A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

  • scroll_id string Required

Responses

POST /_search/scroll/{scroll_id}
curl \
 -X POST http://api.example.com/_search/scroll/{scroll_id} \
 -H "Content-Type: application/json" \
 -d '{"scroll":"string","scroll_id":"string"}'
Request examples
{
  "scroll": "string",
  "scroll_id": "string"
}
Response examples (200)
{
  "took": 42.0,
  "timed_out": true,
  "_shards": {
    "failed": 42.0,
    "successful": 42.0,
    "total": 42.0,
    "failures": [
      {
        "index": "string",
        "node": "string",
        "reason": {
          "type": "string",
          "reason": "string",
          "stack_trace": "string",
          "caused_by": {},
          "root_cause": [
            {}
          ],
          "suppressed": [
            {}
          ]
        },
        "shard": 42.0,
        "status": "string"
      }
    ],
    "skipped": 42.0
  },
  "hits": {
    "total": {
      "relation": "eq",
      "value": 42.0
    },
    "hits": [
      {
        "_index": "string",
        "_id": "string",
        "_score": 42.0,
        "_explanation": {
          "description": "string",
          "details": [
            {}
          ],
          "value": 42.0
        },
        "fields": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "highlight": {
          "additionalProperty1": [
            "string"
          ],
          "additionalProperty2": [
            "string"
          ]
        },
        "inner_hits": {
          "additionalProperty1": {
            "hits": {}
          },
          "additionalProperty2": {
            "hits": {}
          }
        },
        "matched_queries": [
          "string"
        ],
        "_nested": {
          "field": "string",
          "offset": 42.0,
          "_nested": {}
        },
        "_ignored": [
          "string"
        ],
        "ignored_field_values": {
          "additionalProperty1": [
            {}
          ],
          "additionalProperty2": [
            {}
          ]
        },
        "_shard": "string",
        "_node": "string",
        "_routing": "string",
        "_source": {},
        "_rank": 42.0,
        "_seq_no": 42.0,
        "_primary_term": 42.0,
        "_version": 42.0,
        "sort": [
          42.0
        ]
      }
    ],
    "max_score": 42.0
  },
  "aggregations": {},
  "_clusters": {
    "skipped": 42.0,
    "successful": 42.0,
    "total": 42.0,
    "running": 42.0,
    "partial": 42.0,
    "failed": 42.0,
    "details": {
      "additionalProperty1": {
        "status": "running",
        "indices": "string",
        "": 42.0,
        "timed_out": true,
        "_shards": {
          "failed": 42.0,
          "successful": 42.0,
          "total": 42.0,
          "failures": [
            {}
          ],
          "skipped": 42.0
        },
        "failures": [
          {
            "index": "string",
            "node": "string",
            "reason": {},
            "shard": 42.0,
            "status": "string"
          }
        ]
      },
      "additionalProperty2": {
        "status": "running",
        "indices": "string",
        "": 42.0,
        "timed_out": true,
        "_shards": {
          "failed": 42.0,
          "successful": 42.0,
          "total": 42.0,
          "failures": [
            {}
          ],
          "skipped": 42.0
        },
        "failures": [
          {
            "index": "string",
            "node": "string",
            "reason": {},
            "shard": 42.0,
            "status": "string"
          }
        ]
      }
    }
  },
  "fields": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "max_score": 42.0,
  "num_reduce_phases": 42.0,
  "profile": {
    "shards": [
      {
        "aggregations": [
          {
            "breakdown": {},
            "description": "string",
            "type": "string",
            "debug": {},
            "children": [
              {}
            ]
          }
        ],
        "cluster": "string",
        "dfs": {
          "statistics": {
            "type": "string",
            "description": "string",
            "time": "string",
            "breakdown": {},
            "debug": {},
            "children": [
              {}
            ]
          },
          "knn": [
            {}
          ]
        },
        "fetch": {
          "type": "string",
          "description": "string",
          "": 42.0,
          "breakdown": {
            "load_source": 42.0,
            "load_source_count": 42.0,
            "load_stored_fields": 42.0,
            "load_stored_fields_count": 42.0,
            "next_reader": 42.0,
            "next_reader_count": 42.0,
            "process_count": 42.0,
            "process": 42.0
          },
          "debug": {
            "stored_fields": [
              "string"
            ],
            "fast_path": 42.0
          },
          "children": [
            {}
          ]
        },
        "id": "string",
        "index": "string",
        "node_id": "string",
        "searches": [
          {
            "collector": [
              {}
            ],
            "query": [
              {}
            ],
            "rewrite_time": 42.0
          }
        ],
        "shard_id": 42.0
      }
    ]
  },
  "pit_id": "string",
  "_scroll_id": "string",
  "suggest": {
    "additionalProperty1": [
      {
        "length": 42.0,
        "offset": 42.0,
        "text": "string"
      }
    ],
    "additionalProperty2": [
      {
        "length": 42.0,
        "offset": 42.0,
        "text": "string"
      }
    ]
  },
  "terminated_early": true
}








Count search results

GET /_count

Get the number of documents matching a query.

The query can either be provided using a simple query string as a parameter or using the Query DSL defined within the request body. The latter must be nested in a query key, which is the same as the search API.

The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices.

The operation is broadcast across all shards. For each shard ID group, a replica is chosen and the search is run against it. This means that replicas increase the scalability of the count.

Query parameters

  • 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. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

  • analyzer string

    The analyzer to use for the query string. This parameter can be used only when the q query string parameter is specified.

  • If true, wildcard and prefix queries are analyzed. This parameter can be used only when the q query string parameter is specified.

  • The default operator for query string query: AND or OR. This parameter can be used only when the q query string parameter is specified.

    Values are and, AND, or, or OR.

  • df string

    The field to use as a default when no field prefix is given in the query string. This parameter can be used only when the q query string parameter is specified.

  • expand_wildcards string | array[string]

    The 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. It supports comma-separated values, such as open,hidden.

  • ignore_throttled boolean Deprecated

    If true, concrete, expanded, or aliased indices are ignored when frozen.

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

  • lenient boolean

    If true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can be used only when the q query string parameter is specified.

  • The minimum _score value that documents must have to be included in the result.

  • The node or shard the operation should be performed on. By default, it is random.

  • routing string

    A custom value used to route operations to a specific shard.

  • The maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting.

    IMPORTANT: Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.

  • q string

    The query in Lucene query string syntax.

application/json

Body

  • query object

    An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

    Additional properties are allowed.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • count number Required
    • _shards object Required

      Additional properties are allowed.

      Hide _shards attributes Show _shards attributes object
      • failed number Required
      • successful number Required
      • total number Required
      • failures array[object]
        Hide failures attributes Show failures attributes object
        • index string
        • node string
        • reason object Required

          Additional properties are allowed.

          Hide reason attributes Show reason attributes object
          • type string Required

            The type of error

          • reason string

            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.

          • Additional properties are allowed.

          • root_cause array[object]

            Additional properties are allowed.

          • suppressed array[object]

            Additional properties are allowed.

        • shard number Required
        • status string
      • skipped number
GET /_count
curl \
 -X GET http://api.example.com/_count \
 -H "Content-Type: application/json" \
 -d '{"query":{}}'
Request examples
{
  "query": {}
}
Response examples (200)
{
  "count": 42.0,
  "_shards": {
    "failed": 42.0,
    "successful": 42.0,
    "total": 42.0,
    "failures": [
      {
        "index": "string",
        "node": "string",
        "reason": {
          "type": "string",
          "reason": "string",
          "stack_trace": "string",
          "caused_by": {},
          "root_cause": [
            {}
          ],
          "suppressed": [
            {}
          ]
        },
        "shard": 42.0,
        "status": "string"
      }
    ],
    "skipped": 42.0
  }
}
















Explain a document match result

POST /{index}/_explain/{id}

Returns information about why a specific document matches, or doesn’t match, a query.

Path parameters

  • index string Required

    Index names used to limit the request. Only a single index name can be provided to this parameter.

  • id string Required

    Defines the document ID.

Query parameters

  • analyzer string

    Analyzer to use for the query string. This parameter can only be used when the q query string parameter is specified.

  • If true, wildcard and prefix queries are analyzed.

  • The default operator for query string query: AND or OR.

    Values are and, AND, or, or OR.

  • df string

    Field to use as default where no field prefix is given in the query string.

  • lenient boolean

    If true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.

  • Specifies the node or shard the operation should be performed on. Random by default.

  • routing string

    Custom value used to route operations to a specific shard.

  • _source boolean | string | array[string]

    True or false to return the _source field or not, or a list of fields to return.

  • _source_excludes string | array[string]

    A comma-separated list of source fields to exclude from the response.

  • _source_includes string | array[string]

    A comma-separated list of source fields to include in the response.

  • stored_fields string | array[string]

    A comma-separated list of stored fields to return in the response.

  • q string

    Query in the Lucene query string syntax.

application/json

Body

  • query object

    An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

    Additional properties are allowed.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
POST /{index}/_explain/{id}
curl \
 -X POST http://api.example.com/{index}/_explain/{id} \
 -H "Content-Type: application/json" \
 -d '{"query":{}}'
Request examples
{
  "query": {}
}
Response examples (200)
{
  "_index": "string",
  "_id": "string",
  "matched": true,
  "explanation": {
    "description": "string",
    "details": [
      {}
    ],
    "value": 42.0
  },
  "get": {
    "fields": {
      "additionalProperty1": {},
      "additionalProperty2": {}
    },
    "found": true,
    "_seq_no": 42.0,
    "_primary_term": 42.0,
    "_routing": "string",
    "_source": {}
  }
}








































Query parameters

  • If true, network round-trips are minimized for cross-cluster search requests.

  • Maximum number of concurrent searches the API can run.

  • The type of the search operation. Available options: query_then_fetch, dfs_query_then_fetch.

    Values are query_then_fetch or dfs_query_then_fetch.

  • If true, the response returns hits.total as an integer. If false, it returns hits.total as an object.

  • typed_keys boolean

    If true, the response prefixes aggregation and suggester names with their respective types.

application/json

Body object Required

One of:

Responses

GET /_msearch/template
curl \
 -X GET http://api.example.com/_msearch/template \
 -H "Content-Type: application/json" \
 -d '[{"allow_no_indices":true,"expand_wildcards":"string","ignore_unavailable":true,"index":"string","preference":"string","request_cache":true,"routing":"string","search_type":"query_then_fetch","ccs_minimize_roundtrips":true,"allow_partial_search_results":true,"ignore_throttled":true}]'
Request examples
[
  {
    "allow_no_indices": true,
    "expand_wildcards": "string",
    "ignore_unavailable": true,
    "index": "string",
    "preference": "string",
    "request_cache": true,
    "routing": "string",
    "search_type": "query_then_fetch",
    "ccs_minimize_roundtrips": true,
    "allow_partial_search_results": true,
    "ignore_throttled": true
  }
]
Response examples (200)
{
  "took": 42.0,
  "responses": [
    {
      "took": 42.0,
      "timed_out": true,
      "_shards": {
        "failed": 42.0,
        "successful": 42.0,
        "total": 42.0,
        "failures": [
          {}
        ],
        "skipped": 42.0
      },
      "hits": {
        "hits": [
          {}
        ]
      },
      "aggregations": {},
      "_clusters": {
        "skipped": 42.0,
        "successful": 42.0,
        "total": 42.0,
        "running": 42.0,
        "partial": 42.0,
        "failed": 42.0,
        "details": {}
      },
      "fields": {
        "additionalProperty1": {},
        "additionalProperty2": {}
      },
      "max_score": 42.0,
      "num_reduce_phases": 42.0,
      "profile": {
        "shards": [
          {}
        ]
      },
      "pit_id": "string",
      "_scroll_id": "string",
      "suggest": {
        "additionalProperty1": [
          {}
        ],
        "additionalProperty2": [
          {}
        ]
      },
      "terminated_early": true,
      "status": 42.0
    }
  ]
}

Run multiple templated searches Added in 5.0.0

POST /_msearch/template

Query parameters

  • If true, network round-trips are minimized for cross-cluster search requests.

  • Maximum number of concurrent searches the API can run.

  • The type of the search operation. Available options: query_then_fetch, dfs_query_then_fetch.

    Values are query_then_fetch or dfs_query_then_fetch.

  • If true, the response returns hits.total as an integer. If false, it returns hits.total as an object.

  • typed_keys boolean

    If true, the response prefixes aggregation and suggester names with their respective types.

application/json

Body object Required

One of:

Responses

POST /_msearch/template
curl \
 -X POST http://api.example.com/_msearch/template \
 -H "Content-Type: application/json" \
 -d '[{"allow_no_indices":true,"expand_wildcards":"string","ignore_unavailable":true,"index":"string","preference":"string","request_cache":true,"routing":"string","search_type":"query_then_fetch","ccs_minimize_roundtrips":true,"allow_partial_search_results":true,"ignore_throttled":true}]'
Request examples
[
  {
    "allow_no_indices": true,
    "expand_wildcards": "string",
    "ignore_unavailable": true,
    "index": "string",
    "preference": "string",
    "request_cache": true,
    "routing": "string",
    "search_type": "query_then_fetch",
    "ccs_minimize_roundtrips": true,
    "allow_partial_search_results": true,
    "ignore_throttled": true
  }
]
Response examples (200)
{
  "took": 42.0,
  "responses": [
    {
      "took": 42.0,
      "timed_out": true,
      "_shards": {
        "failed": 42.0,
        "successful": 42.0,
        "total": 42.0,
        "failures": [
          {}
        ],
        "skipped": 42.0
      },
      "hits": {
        "hits": [
          {}
        ]
      },
      "aggregations": {},
      "_clusters": {
        "skipped": 42.0,
        "successful": 42.0,
        "total": 42.0,
        "running": 42.0,
        "partial": 42.0,
        "failed": 42.0,
        "details": {}
      },
      "fields": {
        "additionalProperty1": {},
        "additionalProperty2": {}
      },
      "max_score": 42.0,
      "num_reduce_phases": 42.0,
      "profile": {
        "shards": [
          {}
        ]
      },
      "pit_id": "string",
      "_scroll_id": "string",
      "suggest": {
        "additionalProperty1": [
          {}
        ],
        "additionalProperty2": [
          {}
        ]
      },
      "terminated_early": true,
      "status": 42.0
    }
  ]
}












































Run a search

GET /_search

Get search hits that match the query defined in the request. You can provide search queries using the q query string parameter or the request body. If both are specified, only the query parameter is used.

Query parameters

  • 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. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

  • If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results.

  • analyzer string

    Analyzer to use for the query string. This parameter can only be used when the q query string parameter is specified.

  • If true, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified.

  • 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.

  • If true, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests.

  • The default operator for query string query: AND or OR. This parameter can only be used when the q query string parameter is specified.

    Values are and, AND, or, or OR.

  • df string

    Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified.

  • docvalue_fields string | array[string]

    A comma-separated list of fields to return as the docvalue representation for each hit.

  • expand_wildcards string | 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.

  • explain boolean

    If true, returns detailed information about score computation as part of a hit.

  • If true, concrete, expanded or aliased indices will be ignored when frozen.

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

  • 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) This functionality reruns each named query on every hit in a search response. Typically, this adds a small overhead to a request. However, using computationally expensive named queries on a large number of hits may add significant overhead.

  • lenient boolean

    If true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can only be used when the q query string parameter is specified.

  • Defines 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.

  • The minimum version of the node that can handle the request Any handling node with a lower version will fail the request.

  • Nodes and shards used for the search. By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are: _only_local to run the search only on shards on the local node; _local to, if possible, run the search on shards on the local node, or if not, select shards using the default method; _only_nodes:<node-id>,<node-id> to run the search on only the specified nodes IDs, where, if suitable shards exist on more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select shards from any available node using the default method; _prefer_nodes:<node-id>,<node-id> to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method; _shards:<shard>,<shard> to run the search only on the specified shards; <custom-string> (any string that does not start with _) to route searches with the same <custom-string> to the same shards in the same order.

  • Defines 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 (if date filters are mandatory to match but the shard bounds and the query are disjoint). When unspecified, the pre-filter phase is executed if any of these conditions is met: the request targets more than 128 shards; the request targets one or more read-only index; the primary sort of the query targets an indexed field.

  • If true, the caching of search results is enabled for requests where size is 0. Defaults to index level settings.

  • routing string

    Custom value used to route operations to a specific shard.

  • scroll string

    Period to retain the search context for scrolling. See Scroll search results. By default, this value cannot exceed 1d (24 hours). You can change this limit using the search.max_keep_alive cluster-level setting.

  • How distributed term frequencies are calculated for relevance scoring.

    Values are query_then_fetch or dfs_query_then_fetch.

  • stats array[string]

    Specific tag of the request for logging and statistical purposes.

  • stored_fields string | array[string]

    A comma-separated list of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false. You can pass _source: true to return both source fields and stored fields in the search response.

  • Specifies which field to use for suggestions.

  • Specifies the suggest mode. This parameter can only be used when the suggest_field and suggest_text query string parameters are specified.

    Values are missing, popular, or always.

  • Number of suggestions to return. This parameter can only be used when the suggest_field and suggest_text query string parameters are specified.

  • The source text for which the suggestions should be returned. This parameter can only be used when the suggest_field and suggest_text query string parameters are specified.

  • Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. If set to 0 (default), the query does not terminate early.

  • timeout string

    Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error.

  • track_total_hits boolean | number

    Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query.

  • If true, calculate and return document scores, even if the scores are not used for sorting.

  • typed_keys boolean

    If true, aggregation and suggester names are be prefixed by their respective types in the response.

  • Indicates whether hits.total should be rendered as an integer or an object in the rest search response.

  • version boolean

    If true, returns document version as part of a hit.

  • _source boolean | string | array[string]

    Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response. Valid values are: true to return the entire document source; false to not return the document source; <string> to return the source fields that are specified as a comma-separated list (supports wildcard (*) patterns).

  • _source_excludes string | array[string]

    A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in _source_includes query parameter. If the _source parameter is false, this parameter is ignored.

  • _source_includes string | array[string]

    A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the _source_excludes query parameter. If the _source parameter is false, this parameter is ignored.

  • If true, returns sequence number and primary term of the last modification of each hit.

  • q string

    Query in the Lucene query string syntax using query parameter search. Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.

  • size number

    Defines the number of hits to return. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

  • from number

    Starting document offset. Needs to be non-negative. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

  • sort string | array[string]

    A comma-separated list of : pairs.

  • 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.

application/json

Body

  • Defines the aggregations that are run as part of the search request.

  • collapse object

    Additional properties are allowed.

  • explain boolean

    If true, returns detailed information about score computation as part of a hit.

  • ext object

    Configuration of search extensions defined by Elasticsearch plugins.

    Hide ext attribute Show ext attribute object
    • * object Additional properties

      Additional properties are allowed.

  • from number

    Starting document offset. Needs to be non-negative. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

  • Additional properties are allowed.

    Hide highlight attributes Show highlight attributes object
    • A string that contains each boundary character.

    • How far to scan for boundary characters.

    • Values are chars, sentence, or word.

    • Controls which locale is used to search for sentence and word boundaries. This parameter takes a form of a language tag, for example: "en-US", "fr-FR", "ja-JP".

    • force_source boolean Deprecated
    • Values are simple or span.

    • The size of the highlighted fragment in characters.

    • An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

      Additional properties are allowed.

    • If set to a non-negative value, highlighting stops at this defined maximum limit. The rest of the text is not processed, thus not highlighted and no error is returned The max_analyzed_offset query setting does not override the index.highlight.max_analyzed_offset setting, which prevails when it’s set to lower value than the query setting.

    • The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.

    • The maximum number of fragments to return. If the number of fragments is set to 0, no fragments are returned. Instead, the entire field contents are highlighted and returned. This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required. If number_of_fragments is 0, fragment_size is ignored.

    • options object
      Hide options attribute Show options attribute object
      • * object Additional properties

        Additional properties are allowed.

    • order string

      Value is score.

    • Controls the number of matching phrases in a document that are considered. Prevents the fvh highlighter from analyzing too many phrases and consuming too much memory. When using matched_fields, phrase_limit phrases per matched field are considered. Raising the limit increases query time and consumes more memory. Only supported by the fvh highlighter.

    • post_tags array[string]

      Use in conjunction with pre_tags to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in <em> and </em> tags.

    • pre_tags array[string]

      Use in conjunction with post_tags to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in <em> and </em> tags.

    • By default, only fields that contains a query match are highlighted. Set to false to highlight all fields.

    • Value is styled.

    • encoder string

      Values are default or html.

    • fields object Required
  • track_total_hits boolean | number

    Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query. Defaults to 10,000 hits.

  • indices_boost array[object]

    Boosts the _score of documents from specified indices.

    Hide indices_boost attribute Show indices_boost attribute object
    • * number Additional properties
  • docvalue_fields array[object]

    Array of wildcard (*) patterns. The request returns doc values for field names matching these patterns in the hits.fields property of the response.

    Hide docvalue_fields attributes Show docvalue_fields attributes object
    • field string Required

      Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

    • format string

      Format in which the values are returned.

  • knn object | array[object]

    Defines the approximate kNN search to run.

    One of:
    Hide attributes Show attributes
    • field string Required

      Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

    • query_vector array[number]
    • Additional properties are allowed.

      Hide query_vector_builder attribute Show query_vector_builder attribute object
    • k number

      The final number of nearest neighbors to return as top hits

    • The number of nearest neighbor candidates to consider per shard

    • boost number

      Boost value to apply to kNN scores

    • filter object | array[object]

      Filters for the kNN search query

      One of:

      An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

      Additional properties are allowed.

    • The minimum similarity for a vector to be considered a match

    • Additional properties are allowed.

      Hide inner_hits attributes Show inner_hits attributes object
      • name string
      • size number

        The maximum number of hits to return per inner_hits.

      • from number

        Inner hit starting document offset.

      • collapse object

        Additional properties are allowed.

      • docvalue_fields array[object]
        Hide docvalue_fields attributes Show docvalue_fields attributes object
        • field string Required

          Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

        • format string

          Format in which the values are returned.

      • explain boolean
      • Additional properties are allowed.

        Hide highlight attributes Show highlight attributes object
        • A string that contains each boundary character.

        • How far to scan for boundary characters.

        • Values are chars, sentence, or word.

        • Controls which locale is used to search for sentence and word boundaries. This parameter takes a form of a language tag, for example: "en-US", "fr-FR", "ja-JP".

        • force_source boolean Deprecated
        • Values are simple or span.

        • The size of the highlighted fragment in characters.

        • An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

          Additional properties are allowed.

        • If set to a non-negative value, highlighting stops at this defined maximum limit. The rest of the text is not processed, thus not highlighted and no error is returned The max_analyzed_offset query setting does not override the index.highlight.max_analyzed_offset setting, which prevails when it’s set to lower value than the query setting.

        • The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.

        • The maximum number of fragments to return. If the number of fragments is set to 0, no fragments are returned. Instead, the entire field contents are highlighted and returned. This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required. If number_of_fragments is 0, fragment_size is ignored.

        • options object
          Hide options attribute Show options attribute object
          • * object Additional properties

            Additional properties are allowed.

        • order string

          Value is score.

        • Controls the number of matching phrases in a document that are considered. Prevents the fvh highlighter from analyzing too many phrases and consuming too much memory. When using matched_fields, phrase_limit phrases per matched field are considered. Raising the limit increases query time and consumes more memory. Only supported by the fvh highlighter.

        • post_tags array[string]

          Use in conjunction with pre_tags to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in <em> and </em> tags.

        • pre_tags array[string]

          Use in conjunction with post_tags to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in <em> and </em> tags.

        • By default, only fields that contains a query match are highlighted. Set to false to highlight all fields.

        • Value is styled.

        • encoder string

          Values are default or html.

        • fields object Required
      • Hide script_fields attribute Show script_fields attribute object
        • * object Additional properties

          Additional properties are allowed.

          Hide * attributes Show * attributes object
          • script object Required

            Additional properties are allowed.

            Hide script attributes Show script attributes object
            • source string

              The script source.

            • id string
            • params object

              Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time.

            • options object
      • fields string | array[string]
      • sort string | object | array[string | object]

        One of:

        Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • _source boolean | object

        Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.

        One of:
      • stored_fields string | array[string]
      • version boolean
  • rank object

    Additional properties are allowed.

    Hide rank attribute Show rank attribute object
    • rrf object

      Additional properties are allowed.

      Hide rrf attributes Show rrf attributes object
      • How much influence documents in individual result sets per query have over the final ranked result set

      • Size of the individual result sets per query

  • Minimum _score for matching documents. Documents with a lower _score are not included in the search results.

  • An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

    Additional properties are allowed.

  • profile boolean

    Set to true to return detailed timing information about the execution of individual components in a search request. NOTE: This is a debugging tool and adds significant overhead to search execution.

  • query object

    An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

    Additional properties are allowed.

  • rescore object | array[object]

    Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the query and post_filter phases.

    One of:
    Hide attributes Show attributes
    • query object

      Additional properties are allowed.

      Hide query attributes Show query attributes object
    • Additional properties are allowed.

      Hide learning_to_rank attributes Show learning_to_rank attributes object
      • model_id string Required

        The unique identifier of the trained model uploaded to Elasticsearch

      • params object

        Named parameters to be passed to the query templates used for feature

        Hide params attribute Show params attribute object
        • * object Additional properties

          Additional properties are allowed.

  • Additional properties are allowed.

    Hide retriever attributes Show retriever attributes object
  • Retrieve a script evaluation (based on different fields) for each hit.

    Hide script_fields attribute Show script_fields attribute object
    • * object Additional properties

      Additional properties are allowed.

      Hide * attributes Show * attributes object
      • script object Required

        Additional properties are allowed.

        Hide script attributes Show script attributes object
        • source string

          The script source.

        • id string
        • params object

          Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time.

          Hide params attribute Show params attribute object
          • * object Additional properties

            Additional properties are allowed.

        • lang string

          Any of:

          Values are painless, expression, mustache, or java.

        • options object
          Hide options attribute Show options attribute object
          • * string Additional properties
  • search_after array[number | string | boolean | null | object]
  • size number

    The number of hits to return. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

  • slice object

    Additional properties are allowed.

    Hide slice attributes Show slice attributes object
    • field string

      Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

    • id string Required
    • max number Required
  • sort string | object | array[string | object]

    One of:

    Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

  • _source boolean | object

    Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.

    One of:
  • fields array[object]

    Array of wildcard (*) patterns. The request returns values for field names matching these patterns in the hits.fields property of the response.

    Hide fields attributes Show fields attributes object
    • field string Required

      Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

    • format string

      Format in which the values are returned.

  • suggest object

    Additional properties are allowed.

    Hide suggest attribute Show suggest attribute object
    • text string

      Global suggest text, to avoid repetition when the same text is used in several suggesters

  • Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. If set to 0 (default), the query does not terminate early.

  • timeout string

    Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout.

  • If true, calculate and return document scores, even if the scores are not used for sorting.

  • version boolean

    If true, returns document version as part of a hit.

  • If true, returns sequence number and primary term of the last modification of each hit.

  • stored_fields string | array[string]
  • pit object

    Additional properties are allowed.

    Hide pit attributes Show pit attributes object
    • id string Required
    • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

  • Hide runtime_mappings attribute Show runtime_mappings attribute object
    • * object Additional properties

      Additional properties are allowed.

      Hide * attributes Show * attributes object
      • fields object

        For type composite

        Hide fields attribute Show fields attribute object
        • * object Additional properties

          Additional properties are allowed.

          Hide * attribute Show * attribute object
          • type string Required

            Values are boolean, composite, date, double, geo_point, ip, keyword, long, or lookup.

      • fetch_fields array[object]

        For type lookup

        Hide fetch_fields attributes Show fetch_fields attributes object
        • field string Required

          Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

        • format string
      • format string

        A custom format for date type runtime fields.

      • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • script object

        Additional properties are allowed.

        Hide script attributes Show script attributes object
        • source string

          The script source.

        • id string
        • params object

          Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time.

          Hide params attribute Show params attribute object
          • * object Additional properties

            Additional properties are allowed.

        • lang string

          Any of:

          Values are painless, expression, mustache, or java.

        • options object
          Hide options attribute Show options attribute object
          • * string Additional properties
      • type string Required

        Values are boolean, composite, date, double, geo_point, ip, keyword, long, or lookup.

  • stats array[string]

    Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. You can retrieve these stats using the indices stats API.

Responses

GET /_search
curl \
 -X GET http://api.example.com/_search \
 -H "Content-Type: application/json" \
 -d '{"aggregations":{},"collapse":{},"explain":true,"ext":{"additionalProperty1":{},"additionalProperty2":{}},"from":42.0,"":true,"track_total_hits":true,"indices_boost":[{"additionalProperty1":42.0,"additionalProperty2":42.0}],"docvalue_fields":[{"field":"string","format":"string","include_unmapped":true}],"knn":{"field":"string","query_vector":[42.0],"query_vector_builder":{"text_embedding":{"model_id":"string","model_text":"string"}},"k":42.0,"num_candidates":42.0,"boost":42.0,"filter":{},"similarity":42.0,"inner_hits":{"name":"string","size":42.0,"from":42.0,"collapse":{},"docvalue_fields":[{"field":"string","format":"string","include_unmapped":true}],"explain":true,"":true,"ignore_unmapped":true,"script_fields":{"additionalProperty1":{"script":{"source":"string","id":"string","params":{},"options":{}},"ignore_failure":true},"additionalProperty2":{"script":{"source":"string","id":"string","params":{},"options":{}},"ignore_failure":true}},"seq_no_primary_term":true,"fields":"string","stored_fields":"string","track_scores":true,"version":true}},"rank":{"":{"rank_constant":42.0,"rank_window_size":42.0}},"min_score":42.0,"post_filter":{},"profile":true,"query":{},"retriever":{"":{"filter":{},"min_score":42.0,"ruleset_ids":["string"],"match_criteria":{},"retriever":{},"rank_window_size":42.0}},"script_fields":{"additionalProperty1":{"script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"ignore_failure":true},"additionalProperty2":{"script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"ignore_failure":true}},"search_after":[42.0],"size":42.0,"slice":{"field":"string","id":"string","max":42.0},"fields":[{"field":"string","format":"string","include_unmapped":true}],"suggest":{"text":"string"},"terminate_after":42.0,"timeout":"string","track_scores":true,"version":true,"seq_no_primary_term":true,"stored_fields":"string","pit":{"id":"string","keep_alive":"string"},"runtime_mappings":{"additionalProperty1":{"fields":{"additionalProperty1":{"type":"boolean"},"additionalProperty2":{"type":"boolean"}},"fetch_fields":[{"field":"string","format":"string"}],"format":"string","input_field":"string","target_field":"string","target_index":"string","script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"type":"boolean"},"additionalProperty2":{"fields":{"additionalProperty1":{"type":"boolean"},"additionalProperty2":{"type":"boolean"}},"fetch_fields":[{"field":"string","format":"string"}],"format":"string","input_field":"string","target_field":"string","target_index":"string","script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"type":"boolean"}},"stats":["string"]}'
Request examples
{
  "aggregations": {},
  "collapse": {},
  "explain": true,
  "ext": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "from": 42.0,
  "": true,
  "track_total_hits": true,
  "indices_boost": [
    {
      "additionalProperty1": 42.0,
      "additionalProperty2": 42.0
    }
  ],
  "docvalue_fields": [
    {
      "field": "string",
      "format": "string",
      "include_unmapped": true
    }
  ],
  "knn": {
    "field": "string",
    "query_vector": [
      42.0
    ],
    "query_vector_builder": {
      "text_embedding": {
        "model_id": "string",
        "model_text": "string"
      }
    },
    "k": 42.0,
    "num_candidates": 42.0,
    "boost": 42.0,
    "filter": {},
    "similarity": 42.0,
    "inner_hits": {
      "name": "string",
      "size": 42.0,
      "from": 42.0,
      "collapse": {},
      "docvalue_fields": [
        {
          "field": "string",
          "format": "string",
          "include_unmapped": true
        }
      ],
      "explain": true,
      "": true,
      "ignore_unmapped": true,
      "script_fields": {
        "additionalProperty1": {
          "script": {
            "source": "string",
            "id": "string",
            "params": {},
            "options": {}
          },
          "ignore_failure": true
        },
        "additionalProperty2": {
          "script": {
            "source": "string",
            "id": "string",
            "params": {},
            "options": {}
          },
          "ignore_failure": true
        }
      },
      "seq_no_primary_term": true,
      "fields": "string",
      "stored_fields": "string",
      "track_scores": true,
      "version": true
    }
  },
  "rank": {
    "": {
      "rank_constant": 42.0,
      "rank_window_size": 42.0
    }
  },
  "min_score": 42.0,
  "post_filter": {},
  "profile": true,
  "query": {},
  "retriever": {
    "": {
      "filter": {},
      "min_score": 42.0,
      "ruleset_ids": [
        "string"
      ],
      "match_criteria": {},
      "retriever": {},
      "rank_window_size": 42.0
    }
  },
  "script_fields": {
    "additionalProperty1": {
      "script": {
        "source": "string",
        "id": "string",
        "params": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "": "painless",
        "options": {
          "additionalProperty1": "string",
          "additionalProperty2": "string"
        }
      },
      "ignore_failure": true
    },
    "additionalProperty2": {
      "script": {
        "source": "string",
        "id": "string",
        "params": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "": "painless",
        "options": {
          "additionalProperty1": "string",
          "additionalProperty2": "string"
        }
      },
      "ignore_failure": true
    }
  },
  "search_after": [
    42.0
  ],
  "size": 42.0,
  "slice": {
    "field": "string",
    "id": "string",
    "max": 42.0
  },
  "fields": [
    {
      "field": "string",
      "format": "string",
      "include_unmapped": true
    }
  ],
  "suggest": {
    "text": "string"
  },
  "terminate_after": 42.0,
  "timeout": "string",
  "track_scores": true,
  "version": true,
  "seq_no_primary_term": true,
  "stored_fields": "string",
  "pit": {
    "id": "string",
    "keep_alive": "string"
  },
  "runtime_mappings": {
    "additionalProperty1": {
      "fields": {
        "additionalProperty1": {
          "type": "boolean"
        },
        "additionalProperty2": {
          "type": "boolean"
        }
      },
      "fetch_fields": [
        {
          "field": "string",
          "format": "string"
        }
      ],
      "format": "string",
      "input_field": "string",
      "target_field": "string",
      "target_index": "string",
      "script": {
        "source": "string",
        "id": "string",
        "params": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "": "painless",
        "options": {
          "additionalProperty1": "string",
          "additionalProperty2": "string"
        }
      },
      "type": "boolean"
    },
    "additionalProperty2": {
      "fields": {
        "additionalProperty1": {
          "type": "boolean"
        },
        "additionalProperty2": {
          "type": "boolean"
        }
      },
      "fetch_fields": [
        {
          "field": "string",
          "format": "string"
        }
      ],
      "format": "string",
      "input_field": "string",
      "target_field": "string",
      "target_index": "string",
      "script": {
        "source": "string",
        "id": "string",
        "params": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "": "painless",
        "options": {
          "additionalProperty1": "string",
          "additionalProperty2": "string"
        }
      },
      "type": "boolean"
    }
  },
  "stats": [
    "string"
  ]
}
Response examples (200)
{
  "took": 42.0,
  "timed_out": true,
  "_shards": {
    "failed": 42.0,
    "successful": 42.0,
    "total": 42.0,
    "failures": [
      {
        "index": "string",
        "node": "string",
        "reason": {
          "type": "string",
          "reason": "string",
          "stack_trace": "string",
          "caused_by": {},
          "root_cause": [
            {}
          ],
          "suppressed": [
            {}
          ]
        },
        "shard": 42.0,
        "status": "string"
      }
    ],
    "skipped": 42.0
  },
  "hits": {
    "total": {
      "relation": "eq",
      "value": 42.0
    },
    "hits": [
      {
        "_index": "string",
        "_id": "string",
        "_score": 42.0,
        "_explanation": {
          "description": "string",
          "details": [
            {}
          ],
          "value": 42.0
        },
        "fields": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "highlight": {
          "additionalProperty1": [
            "string"
          ],
          "additionalProperty2": [
            "string"
          ]
        },
        "inner_hits": {
          "additionalProperty1": {
            "hits": {}
          },
          "additionalProperty2": {
            "hits": {}
          }
        },
        "matched_queries": [
          "string"
        ],
        "_nested": {
          "field": "string",
          "offset": 42.0,
          "_nested": {}
        },
        "_ignored": [
          "string"
        ],
        "ignored_field_values": {
          "additionalProperty1": [
            {}
          ],
          "additionalProperty2": [
            {}
          ]
        },
        "_shard": "string",
        "_node": "string",
        "_routing": "string",
        "_source": {},
        "_rank": 42.0,
        "_seq_no": 42.0,
        "_primary_term": 42.0,
        "_version": 42.0,
        "sort": [
          42.0
        ]
      }
    ],
    "max_score": 42.0
  },
  "aggregations": {},
  "_clusters": {
    "skipped": 42.0,
    "successful": 42.0,
    "total": 42.0,
    "running": 42.0,
    "partial": 42.0,
    "failed": 42.0,
    "details": {
      "additionalProperty1": {
        "status": "running",
        "indices": "string",
        "": 42.0,
        "timed_out": true,
        "_shards": {
          "failed": 42.0,
          "successful": 42.0,
          "total": 42.0,
          "failures": [
            {}
          ],
          "skipped": 42.0
        },
        "failures": [
          {
            "index": "string",
            "node": "string",
            "reason": {},
            "shard": 42.0,
            "status": "string"
          }
        ]
      },
      "additionalProperty2": {
        "status": "running",
        "indices": "string",
        "": 42.0,
        "timed_out": true,
        "_shards": {
          "failed": 42.0,
          "successful": 42.0,
          "total": 42.0,
          "failures": [
            {}
          ],
          "skipped": 42.0
        },
        "failures": [
          {
            "index": "string",
            "node": "string",
            "reason": {},
            "shard": 42.0,
            "status": "string"
          }
        ]
      }
    }
  },
  "fields": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "max_score": 42.0,
  "num_reduce_phases": 42.0,
  "profile": {
    "shards": [
      {
        "aggregations": [
          {
            "breakdown": {},
            "description": "string",
            "type": "string",
            "debug": {},
            "children": [
              {}
            ]
          }
        ],
        "cluster": "string",
        "dfs": {
          "statistics": {
            "type": "string",
            "description": "string",
            "time": "string",
            "breakdown": {},
            "debug": {},
            "children": [
              {}
            ]
          },
          "knn": [
            {}
          ]
        },
        "fetch": {
          "type": "string",
          "description": "string",
          "": 42.0,
          "breakdown": {
            "load_source": 42.0,
            "load_source_count": 42.0,
            "load_stored_fields": 42.0,
            "load_stored_fields_count": 42.0,
            "next_reader": 42.0,
            "next_reader_count": 42.0,
            "process_count": 42.0,
            "process": 42.0
          },
          "debug": {
            "stored_fields": [
              "string"
            ],
            "fast_path": 42.0
          },
          "children": [
            {}
          ]
        },
        "id": "string",
        "index": "string",
        "node_id": "string",
        "searches": [
          {
            "collector": [
              {}
            ],
            "query": [
              {}
            ],
            "rewrite_time": 42.0
          }
        ],
        "shard_id": 42.0
      }
    ]
  },
  "pit_id": "string",
  "_scroll_id": "string",
  "suggest": {
    "additionalProperty1": [
      {
        "length": 42.0,
        "offset": 42.0,
        "text": "string"
      }
    ],
    "additionalProperty2": [
      {
        "length": 42.0,
        "offset": 42.0,
        "text": "string"
      }
    ]
  },
  "terminated_early": true
}

Run a search

POST /_search

Get search hits that match the query defined in the request. You can provide search queries using the q query string parameter or the request body. If both are specified, only the query parameter is used.

Query parameters

  • 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. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

  • If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results.

  • analyzer string

    Analyzer to use for the query string. This parameter can only be used when the q query string parameter is specified.

  • If true, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified.

  • 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.

  • If true, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests.

  • The default operator for query string query: AND or OR. This parameter can only be used when the q query string parameter is specified.

    Values are and, AND, or, or OR.

  • df string

    Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified.

  • docvalue_fields string | array[string]

    A comma-separated list of fields to return as the docvalue representation for each hit.

  • expand_wildcards string | 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.

  • explain boolean

    If true, returns detailed information about score computation as part of a hit.

  • If true, concrete, expanded or aliased indices will be ignored when frozen.

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

  • 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) This functionality reruns each named query on every hit in a search response. Typically, this adds a small overhead to a request. However, using computationally expensive named queries on a large number of hits may add significant overhead.

  • lenient boolean

    If true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can only be used when the q query string parameter is specified.

  • Defines 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.

  • The minimum version of the node that can handle the request Any handling node with a lower version will fail the request.

  • Nodes and shards used for the search. By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are: _only_local to run the search only on shards on the local node; _local to, if possible, run the search on shards on the local node, or if not, select shards using the default method; _only_nodes:<node-id>,<node-id> to run the search on only the specified nodes IDs, where, if suitable shards exist on more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select shards from any available node using the default method; _prefer_nodes:<node-id>,<node-id> to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method; _shards:<shard>,<shard> to run the search only on the specified shards; <custom-string> (any string that does not start with _) to route searches with the same <custom-string> to the same shards in the same order.

  • Defines 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 (if date filters are mandatory to match but the shard bounds and the query are disjoint). When unspecified, the pre-filter phase is executed if any of these conditions is met: the request targets more than 128 shards; the request targets one or more read-only index; the primary sort of the query targets an indexed field.

  • If true, the caching of search results is enabled for requests where size is 0. Defaults to index level settings.

  • routing string

    Custom value used to route operations to a specific shard.

  • scroll string

    Period to retain the search context for scrolling. See Scroll search results. By default, this value cannot exceed 1d (24 hours). You can change this limit using the search.max_keep_alive cluster-level setting.

  • How distributed term frequencies are calculated for relevance scoring.

    Values are query_then_fetch or dfs_query_then_fetch.

  • stats array[string]

    Specific tag of the request for logging and statistical purposes.

  • stored_fields string | array[string]

    A comma-separated list of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false. You can pass _source: true to return both source fields and stored fields in the search response.

  • Specifies which field to use for suggestions.

  • Specifies the suggest mode. This parameter can only be used when the suggest_field and suggest_text query string parameters are specified.

    Values are missing, popular, or always.

  • Number of suggestions to return. This parameter can only be used when the suggest_field and suggest_text query string parameters are specified.

  • The source text for which the suggestions should be returned. This parameter can only be used when the suggest_field and suggest_text query string parameters are specified.

  • Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. If set to 0 (default), the query does not terminate early.

  • timeout string

    Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error.

  • track_total_hits boolean | number

    Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query.

  • If true, calculate and return document scores, even if the scores are not used for sorting.

  • typed_keys boolean

    If true, aggregation and suggester names are be prefixed by their respective types in the response.

  • Indicates whether hits.total should be rendered as an integer or an object in the rest search response.

  • version boolean

    If true, returns document version as part of a hit.

  • _source boolean | string | array[string]

    Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response. Valid values are: true to return the entire document source; false to not return the document source; <string> to return the source fields that are specified as a comma-separated list (supports wildcard (*) patterns).

  • _source_excludes string | array[string]

    A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in _source_includes query parameter. If the _source parameter is false, this parameter is ignored.

  • _source_includes string | array[string]

    A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the _source_excludes query parameter. If the _source parameter is false, this parameter is ignored.

  • If true, returns sequence number and primary term of the last modification of each hit.

  • q string

    Query in the Lucene query string syntax using query parameter search. Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.

  • size number

    Defines the number of hits to return. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

  • from number

    Starting document offset. Needs to be non-negative. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

  • sort string | array[string]

    A comma-separated list of : pairs.

  • 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.

application/json

Body

  • Defines the aggregations that are run as part of the search request.

  • collapse object

    Additional properties are allowed.

  • explain boolean

    If true, returns detailed information about score computation as part of a hit.

  • ext object

    Configuration of search extensions defined by Elasticsearch plugins.

    Hide ext attribute Show ext attribute object
    • * object Additional properties

      Additional properties are allowed.

  • from number

    Starting document offset. Needs to be non-negative. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

  • Additional properties are allowed.

    Hide highlight attributes Show highlight attributes object
    • A string that contains each boundary character.

    • How far to scan for boundary characters.

    • Values are chars, sentence, or word.

    • Controls which locale is used to search for sentence and word boundaries. This parameter takes a form of a language tag, for example: "en-US", "fr-FR", "ja-JP".

    • force_source boolean Deprecated
    • Values are simple or span.

    • The size of the highlighted fragment in characters.

    • An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

      Additional properties are allowed.

    • If set to a non-negative value, highlighting stops at this defined maximum limit. The rest of the text is not processed, thus not highlighted and no error is returned The max_analyzed_offset query setting does not override the index.highlight.max_analyzed_offset setting, which prevails when it’s set to lower value than the query setting.

    • The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.

    • The maximum number of fragments to return. If the number of fragments is set to 0, no fragments are returned. Instead, the entire field contents are highlighted and returned. This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required. If number_of_fragments is 0, fragment_size is ignored.

    • options object
      Hide options attribute Show options attribute object
      • * object Additional properties

        Additional properties are allowed.

    • order string

      Value is score.

    • Controls the number of matching phrases in a document that are considered. Prevents the fvh highlighter from analyzing too many phrases and consuming too much memory. When using matched_fields, phrase_limit phrases per matched field are considered. Raising the limit increases query time and consumes more memory. Only supported by the fvh highlighter.

    • post_tags array[string]

      Use in conjunction with pre_tags to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in <em> and </em> tags.

    • pre_tags array[string]

      Use in conjunction with post_tags to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in <em> and </em> tags.

    • By default, only fields that contains a query match are highlighted. Set to false to highlight all fields.

    • Value is styled.

    • encoder string

      Values are default or html.

    • fields object Required
  • track_total_hits boolean | number

    Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query. Defaults to 10,000 hits.

  • indices_boost array[object]

    Boosts the _score of documents from specified indices.

    Hide indices_boost attribute Show indices_boost attribute object
    • * number Additional properties
  • docvalue_fields array[object]

    Array of wildcard (*) patterns. The request returns doc values for field names matching these patterns in the hits.fields property of the response.

    Hide docvalue_fields attributes Show docvalue_fields attributes object
    • field string Required

      Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

    • format string

      Format in which the values are returned.

  • knn object | array[object]

    Defines the approximate kNN search to run.

    One of:
    Hide attributes Show attributes
    • field string Required

      Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

    • query_vector array[number]
    • Additional properties are allowed.

      Hide query_vector_builder attribute Show query_vector_builder attribute object
    • k number

      The final number of nearest neighbors to return as top hits

    • The number of nearest neighbor candidates to consider per shard

    • boost number

      Boost value to apply to kNN scores

    • filter object | array[object]

      Filters for the kNN search query

      One of:

      An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

      Additional properties are allowed.

    • The minimum similarity for a vector to be considered a match

    • Additional properties are allowed.

      Hide inner_hits attributes Show inner_hits attributes object
      • name string
      • size number

        The maximum number of hits to return per inner_hits.

      • from number

        Inner hit starting document offset.

      • collapse object

        Additional properties are allowed.

      • docvalue_fields array[object]
        Hide docvalue_fields attributes Show docvalue_fields attributes object
        • field string Required

          Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

        • format string

          Format in which the values are returned.

      • explain boolean
      • Additional properties are allowed.

        Hide highlight attributes Show highlight attributes object
        • A string that contains each boundary character.

        • How far to scan for boundary characters.

        • Values are chars, sentence, or word.

        • Controls which locale is used to search for sentence and word boundaries. This parameter takes a form of a language tag, for example: "en-US", "fr-FR", "ja-JP".

        • force_source boolean Deprecated
        • Values are simple or span.

        • The size of the highlighted fragment in characters.

        • An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

          Additional properties are allowed.

        • If set to a non-negative value, highlighting stops at this defined maximum limit. The rest of the text is not processed, thus not highlighted and no error is returned The max_analyzed_offset query setting does not override the index.highlight.max_analyzed_offset setting, which prevails when it’s set to lower value than the query setting.

        • The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.

        • The maximum number of fragments to return. If the number of fragments is set to 0, no fragments are returned. Instead, the entire field contents are highlighted and returned. This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required. If number_of_fragments is 0, fragment_size is ignored.

        • options object
          Hide options attribute Show options attribute object
          • * object Additional properties

            Additional properties are allowed.

        • order string

          Value is score.

        • Controls the number of matching phrases in a document that are considered. Prevents the fvh highlighter from analyzing too many phrases and consuming too much memory. When using matched_fields, phrase_limit phrases per matched field are considered. Raising the limit increases query time and consumes more memory. Only supported by the fvh highlighter.

        • post_tags array[string]

          Use in conjunction with pre_tags to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in <em> and </em> tags.

        • pre_tags array[string]

          Use in conjunction with post_tags to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in <em> and </em> tags.

        • By default, only fields that contains a query match are highlighted. Set to false to highlight all fields.

        • Value is styled.

        • encoder string

          Values are default or html.

        • fields object Required
      • Hide script_fields attribute Show script_fields attribute object
        • * object Additional properties

          Additional properties are allowed.

          Hide * attributes Show * attributes object
          • script object Required

            Additional properties are allowed.

            Hide script attributes Show script attributes object
            • source string

              The script source.

            • id string
            • params object

              Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time.

            • options object
      • fields string | array[string]
      • sort string | object | array[string | object]

        One of:

        Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • _source boolean | object

        Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.

        One of:
      • stored_fields string | array[string]
      • version boolean
  • rank object

    Additional properties are allowed.

    Hide rank attribute Show rank attribute object
    • rrf object

      Additional properties are allowed.

      Hide rrf attributes Show rrf attributes object
      • How much influence documents in individual result sets per query have over the final ranked result set

      • Size of the individual result sets per query

  • Minimum _score for matching documents. Documents with a lower _score are not included in the search results.

  • An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

    Additional properties are allowed.

  • profile boolean

    Set to true to return detailed timing information about the execution of individual components in a search request. NOTE: This is a debugging tool and adds significant overhead to search execution.

  • query object

    An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

    Additional properties are allowed.

  • rescore object | array[object]

    Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the query and post_filter phases.

    One of:
    Hide attributes Show attributes
    • query object

      Additional properties are allowed.

      Hide query attributes Show query attributes object
    • Additional properties are allowed.

      Hide learning_to_rank attributes Show learning_to_rank attributes object
      • model_id string Required

        The unique identifier of the trained model uploaded to Elasticsearch

      • params object

        Named parameters to be passed to the query templates used for feature

        Hide params attribute Show params attribute object
        • * object Additional properties

          Additional properties are allowed.

  • Additional properties are allowed.

    Hide retriever attributes Show retriever attributes object
  • Retrieve a script evaluation (based on different fields) for each hit.

    Hide script_fields attribute Show script_fields attribute object
    • * object Additional properties

      Additional properties are allowed.

      Hide * attributes Show * attributes object
      • script object Required

        Additional properties are allowed.

        Hide script attributes Show script attributes object
        • source string

          The script source.

        • id string
        • params object

          Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time.

          Hide params attribute Show params attribute object
          • * object Additional properties

            Additional properties are allowed.

        • lang string

          Any of:

          Values are painless, expression, mustache, or java.

        • options object
          Hide options attribute Show options attribute object
          • * string Additional properties
  • search_after array[number | string | boolean | null | object]
  • size number

    The number of hits to return. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

  • slice object

    Additional properties are allowed.

    Hide slice attributes Show slice attributes object
    • field string

      Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

    • id string Required
    • max number Required
  • sort string | object | array[string | object]

    One of:

    Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

  • _source boolean | object

    Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.

    One of:
  • fields array[object]

    Array of wildcard (*) patterns. The request returns values for field names matching these patterns in the hits.fields property of the response.

    Hide fields attributes Show fields attributes object
    • field string Required

      Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

    • format string

      Format in which the values are returned.

  • suggest object

    Additional properties are allowed.

    Hide suggest attribute Show suggest attribute object
    • text string

      Global suggest text, to avoid repetition when the same text is used in several suggesters

  • Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. If set to 0 (default), the query does not terminate early.

  • timeout string

    Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout.

  • If true, calculate and return document scores, even if the scores are not used for sorting.

  • version boolean

    If true, returns document version as part of a hit.

  • If true, returns sequence number and primary term of the last modification of each hit.

  • stored_fields string | array[string]
  • pit object

    Additional properties are allowed.

    Hide pit attributes Show pit attributes object
    • id string Required
    • A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

  • Hide runtime_mappings attribute Show runtime_mappings attribute object
    • * object Additional properties

      Additional properties are allowed.

      Hide * attributes Show * attributes object
      • fields object

        For type composite

        Hide fields attribute Show fields attribute object
        • * object Additional properties

          Additional properties are allowed.

          Hide * attribute Show * attribute object
          • type string Required

            Values are boolean, composite, date, double, geo_point, ip, keyword, long, or lookup.

      • fetch_fields array[object]

        For type lookup

        Hide fetch_fields attributes Show fetch_fields attributes object
        • field string Required

          Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

        • format string
      • format string

        A custom format for date type runtime fields.

      • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • script object

        Additional properties are allowed.

        Hide script attributes Show script attributes object
        • source string

          The script source.

        • id string
        • params object

          Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time.

          Hide params attribute Show params attribute object
          • * object Additional properties

            Additional properties are allowed.

        • lang string

          Any of:

          Values are painless, expression, mustache, or java.

        • options object
          Hide options attribute Show options attribute object
          • * string Additional properties
      • type string Required

        Values are boolean, composite, date, double, geo_point, ip, keyword, long, or lookup.

  • stats array[string]

    Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. You can retrieve these stats using the indices stats API.

Responses

POST /_search
curl \
 -X POST http://api.example.com/_search \
 -H "Content-Type: application/json" \
 -d '{"aggregations":{},"collapse":{},"explain":true,"ext":{"additionalProperty1":{},"additionalProperty2":{}},"from":42.0,"":true,"track_total_hits":true,"indices_boost":[{"additionalProperty1":42.0,"additionalProperty2":42.0}],"docvalue_fields":[{"field":"string","format":"string","include_unmapped":true}],"knn":{"field":"string","query_vector":[42.0],"query_vector_builder":{"text_embedding":{"model_id":"string","model_text":"string"}},"k":42.0,"num_candidates":42.0,"boost":42.0,"filter":{},"similarity":42.0,"inner_hits":{"name":"string","size":42.0,"from":42.0,"collapse":{},"docvalue_fields":[{"field":"string","format":"string","include_unmapped":true}],"explain":true,"":true,"ignore_unmapped":true,"script_fields":{"additionalProperty1":{"script":{"source":"string","id":"string","params":{},"options":{}},"ignore_failure":true},"additionalProperty2":{"script":{"source":"string","id":"string","params":{},"options":{}},"ignore_failure":true}},"seq_no_primary_term":true,"fields":"string","stored_fields":"string","track_scores":true,"version":true}},"rank":{"":{"rank_constant":42.0,"rank_window_size":42.0}},"min_score":42.0,"post_filter":{},"profile":true,"query":{},"retriever":{"":{"filter":{},"min_score":42.0,"ruleset_ids":["string"],"match_criteria":{},"retriever":{},"rank_window_size":42.0}},"script_fields":{"additionalProperty1":{"script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"ignore_failure":true},"additionalProperty2":{"script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"ignore_failure":true}},"search_after":[42.0],"size":42.0,"slice":{"field":"string","id":"string","max":42.0},"fields":[{"field":"string","format":"string","include_unmapped":true}],"suggest":{"text":"string"},"terminate_after":42.0,"timeout":"string","track_scores":true,"version":true,"seq_no_primary_term":true,"stored_fields":"string","pit":{"id":"string","keep_alive":"string"},"runtime_mappings":{"additionalProperty1":{"fields":{"additionalProperty1":{"type":"boolean"},"additionalProperty2":{"type":"boolean"}},"fetch_fields":[{"field":"string","format":"string"}],"format":"string","input_field":"string","target_field":"string","target_index":"string","script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"type":"boolean"},"additionalProperty2":{"fields":{"additionalProperty1":{"type":"boolean"},"additionalProperty2":{"type":"boolean"}},"fetch_fields":[{"field":"string","format":"string"}],"format":"string","input_field":"string","target_field":"string","target_index":"string","script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"type":"boolean"}},"stats":["string"]}'
Request examples
{
  "aggregations": {},
  "collapse": {},
  "explain": true,
  "ext": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "from": 42.0,
  "": true,
  "track_total_hits": true,
  "indices_boost": [
    {
      "additionalProperty1": 42.0,
      "additionalProperty2": 42.0
    }
  ],
  "docvalue_fields": [
    {
      "field": "string",
      "format": "string",
      "include_unmapped": true
    }
  ],
  "knn": {
    "field": "string",
    "query_vector": [
      42.0
    ],
    "query_vector_builder": {
      "text_embedding": {
        "model_id": "string",
        "model_text": "string"
      }
    },
    "k": 42.0,
    "num_candidates": 42.0,
    "boost": 42.0,
    "filter": {},
    "similarity": 42.0,
    "inner_hits": {
      "name": "string",
      "size": 42.0,
      "from": 42.0,
      "collapse": {},
      "docvalue_fields": [
        {
          "field": "string",
          "format": "string",
          "include_unmapped": true
        }
      ],
      "explain": true,
      "": true,
      "ignore_unmapped": true,
      "script_fields": {
        "additionalProperty1": {
          "script": {
            "source": "string",
            "id": "string",
            "params": {},
            "options": {}
          },
          "ignore_failure": true
        },
        "additionalProperty2": {
          "script": {
            "source": "string",
            "id": "string",
            "params": {},
            "options": {}
          },
          "ignore_failure": true
        }
      },
      "seq_no_primary_term": true,
      "fields": "string",
      "stored_fields": "string",
      "track_scores": true,
      "version": true
    }
  },
  "rank": {
    "": {
      "rank_constant": 42.0,
      "rank_window_size": 42.0
    }
  },
  "min_score": 42.0,
  "post_filter": {},
  "profile": true,
  "query": {},
  "retriever": {
    "": {
      "filter": {},
      "min_score": 42.0,
      "ruleset_ids": [
        "string"
      ],
      "match_criteria": {},
      "retriever": {},
      "rank_window_size": 42.0
    }
  },
  "script_fields": {
    "additionalProperty1": {
      "script": {
        "source": "string",
        "id": "string",
        "params": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "": "painless",
        "options": {
          "additionalProperty1": "string",
          "additionalProperty2": "string"
        }
      },
      "ignore_failure": true
    },
    "additionalProperty2": {
      "script": {
        "source": "string",
        "id": "string",
        "params": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "": "painless",
        "options": {
          "additionalProperty1": "string",
          "additionalProperty2": "string"
        }
      },
      "ignore_failure": true
    }
  },
  "search_after": [
    42.0
  ],
  "size": 42.0,
  "slice": {
    "field": "string",
    "id": "string",
    "max": 42.0
  },
  "fields": [
    {
      "field": "string",
      "format": "string",
      "include_unmapped": true
    }
  ],
  "suggest": {
    "text": "string"
  },
  "terminate_after": 42.0,
  "timeout": "string",
  "track_scores": true,
  "version": true,
  "seq_no_primary_term": true,
  "stored_fields": "string",
  "pit": {
    "id": "string",
    "keep_alive": "string"
  },
  "runtime_mappings": {
    "additionalProperty1": {
      "fields": {
        "additionalProperty1": {
          "type": "boolean"
        },
        "additionalProperty2": {
          "type": "boolean"
        }
      },
      "fetch_fields": [
        {
          "field": "string",
          "format": "string"
        }
      ],
      "format": "string",
      "input_field": "string",
      "target_field": "string",
      "target_index": "string",
      "script": {
        "source": "string",
        "id": "string",
        "params": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "": "painless",
        "options": {
          "additionalProperty1": "string",
          "additionalProperty2": "string"
        }
      },
      "type": "boolean"
    },
    "additionalProperty2": {
      "fields": {
        "additionalProperty1": {
          "type": "boolean"
        },
        "additionalProperty2": {
          "type": "boolean"
        }
      },
      "fetch_fields": [
        {
          "field": "string",
          "format": "string"
        }
      ],
      "format": "string",
      "input_field": "string",
      "target_field": "string",
      "target_index": "string",
      "script": {
        "source": "string",
        "id": "string",
        "params": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "": "painless",
        "options": {
          "additionalProperty1": "string",
          "additionalProperty2": "string"
        }
      },
      "type": "boolean"
    }
  },
  "stats": [
    "string"
  ]
}
Response examples (200)
{
  "took": 42.0,
  "timed_out": true,
  "_shards": {
    "failed": 42.0,
    "successful": 42.0,
    "total": 42.0,
    "failures": [
      {
        "index": "string",
        "node": "string",
        "reason": {
          "type": "string",
          "reason": "string",
          "stack_trace": "string",
          "caused_by": {},
          "root_cause": [
            {}
          ],
          "suppressed": [
            {}
          ]
        },
        "shard": 42.0,
        "status": "string"
      }
    ],
    "skipped": 42.0
  },
  "hits": {
    "total": {
      "relation": "eq",
      "value": 42.0
    },
    "hits": [
      {
        "_index": "string",
        "_id": "string",
        "_score": 42.0,
        "_explanation": {
          "description": "string",
          "details": [
            {}
          ],
          "value": 42.0
        },
        "fields": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "highlight": {
          "additionalProperty1": [
            "string"
          ],
          "additionalProperty2": [
            "string"
          ]
        },
        "inner_hits": {
          "additionalProperty1": {
            "hits": {}
          },
          "additionalProperty2": {
            "hits": {}
          }
        },
        "matched_queries": [
          "string"
        ],
        "_nested": {
          "field": "string",
          "offset": 42.0,
          "_nested": {}
        },
        "_ignored": [
          "string"
        ],
        "ignored_field_values": {
          "additionalProperty1": [
            {}
          ],
          "additionalProperty2": [
            {}
          ]
        },
        "_shard": "string",
        "_node": "string",
        "_routing": "string",
        "_source": {},
        "_rank": 42.0,
        "_seq_no": 42.0,
        "_primary_term": 42.0,
        "_version": 42.0,
        "sort": [
          42.0
        ]
      }
    ],
    "max_score": 42.0
  },
  "aggregations": {},
  "_clusters": {
    "skipped": 42.0,
    "successful": 42.0,
    "total": 42.0,
    "running": 42.0,
    "partial": 42.0,
    "failed": 42.0,
    "details": {
      "additionalProperty1": {
        "status": "running",
        "indices": "string",
        "": 42.0,
        "timed_out": true,
        "_shards": {
          "failed": 42.0,
          "successful": 42.0,
          "total": 42.0,
          "failures": [
            {}
          ],
          "skipped": 42.0
        },
        "failures": [
          {
            "index": "string",
            "node": "string",
            "reason": {},
            "shard": 42.0,
            "status": "string"
          }
        ]
      },
      "additionalProperty2": {
        "status": "running",
        "indices": "string",
        "": 42.0,
        "timed_out": true,
        "_shards": {
          "failed": 42.0,
          "successful": 42.0,
          "total": 42.0,
          "failures": [
            {}
          ],
          "skipped": 42.0
        },
        "failures": [
          {
            "index": "string",
            "node": "string",
            "reason": {},
            "shard": 42.0,
            "status": "string"
          }
        ]
      }
    }
  },
  "fields": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "max_score": 42.0,
  "num_reduce_phases": 42.0,
  "profile": {
    "shards": [
      {
        "aggregations": [
          {
            "breakdown": {},
            "description": "string",
            "type": "string",
            "debug": {},
            "children": [
              {}
            ]
          }
        ],
        "cluster": "string",
        "dfs": {
          "statistics": {
            "type": "string",
            "description": "string",
            "time": "string",
            "breakdown": {},
            "debug": {},
            "children": [
              {}
            ]
          },
          "knn": [
            {}
          ]
        },
        "fetch": {
          "type": "string",
          "description": "string",
          "": 42.0,
          "breakdown": {
            "load_source": 42.0,
            "load_source_count": 42.0,
            "load_stored_fields": 42.0,
            "load_stored_fields_count": 42.0,
            "next_reader": 42.0,
            "next_reader_count": 42.0,
            "process_count": 42.0,
            "process": 42.0
          },
          "debug": {
            "stored_fields": [
              "string"
            ],
            "fast_path": 42.0
          },
          "children": [
            {}
          ]
        },
        "id": "string",
        "index": "string",
        "node_id": "string",
        "searches": [
          {
            "collector": [
              {}
            ],
            "query": [
              {}
            ],
            "rewrite_time": 42.0
          }
        ],
        "shard_id": 42.0
      }
    ]
  },
  "pit_id": "string",
  "_scroll_id": "string",
  "suggest": {
    "additionalProperty1": [
      {
        "length": 42.0,
        "offset": 42.0,
        "text": "string"
      }
    ],
    "additionalProperty2": [
      {
        "length": 42.0,
        "offset": 42.0,
        "text": "string"
      }
    ]
  },
  "terminated_early": true
}
































Query parameters

  • 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. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

  • If true, network round-trips are minimized for cross-cluster search requests.

  • expand_wildcards string | 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.

  • explain boolean

    If true, the response includes additional details about score computation as part of a hit.

  • If true, specified concrete, expanded, or aliased indices are not included in the response when throttled.

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

  • Specifies the node or shard the operation should be performed on. Random by default.

  • profile boolean

    If true, the query execution is profiled.

  • routing string

    Custom value used to route operations to a specific shard.

  • scroll string

    Specifies how long a consistent view of the index should be maintained for scrolled search.

  • The type of the search operation.

    Values are query_then_fetch or dfs_query_then_fetch.

  • If true, hits.total are rendered as an integer in the response.

  • typed_keys boolean

    If true, the response prefixes aggregation and suggester names with their respective types.

application/json

Body Required

  • explain boolean

    If true, returns detailed information about score calculation as part of each hit.

  • id string
  • params object

    Key-value pairs used to replace Mustache variables in the template. The key is the variable name. The value is the variable value.

    Hide params attribute Show params attribute object
    • * object Additional properties

      Additional properties are allowed.

  • profile boolean

    If true, the query execution is profiled.

  • source string

    An inline search template. Supports the same parameters as the search API's request body. Also supports Mustache variables. If no id is specified, this parameter is required.

Responses

GET /_search/template
curl \
 -X GET http://api.example.com/_search/template \
 -H "Content-Type: application/json" \
 -d '{"explain":true,"id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"profile":true,"source":"string"}'
Request examples
{
  "explain": true,
  "id": "string",
  "params": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "profile": true,
  "source": "string"
}
Response examples (200)
{
  "took": 42.0,
  "timed_out": true,
  "_shards": {
    "failed": 42.0,
    "successful": 42.0,
    "total": 42.0,
    "failures": [
      {
        "index": "string",
        "node": "string",
        "reason": {
          "type": "string",
          "reason": "string",
          "stack_trace": "string",
          "caused_by": {},
          "root_cause": [
            {}
          ],
          "suppressed": [
            {}
          ]
        },
        "shard": 42.0,
        "status": "string"
      }
    ],
    "skipped": 42.0
  },
  "hits": {
    "total": {
      "relation": "eq",
      "value": 42.0
    },
    "hits": [
      {
        "_index": "string",
        "_id": "string",
        "_score": 42.0,
        "_explanation": {
          "description": "string",
          "details": [
            {}
          ],
          "value": 42.0
        },
        "fields": {
          "additionalProperty1": {},
          "additionalProperty2": {}
        },
        "highlight": {
          "additionalProperty1": [
            "string"
          ],
          "additionalProperty2": [
            "string"
          ]
        },
        "inner_hits": {
          "additionalProperty1": {
            "hits": {}
          },
          "additionalProperty2": {
            "hits": {}
          }
        },
        "matched_queries": [
          "string"
        ],
        "_nested": {
          "field": "string",
          "offset": 42.0,
          "_nested": {}
        },
        "_ignored": [
          "string"
        ],
        "ignored_field_values": {
          "additionalProperty1": [
            {}
          ],
          "additionalProperty2": [
            {}
          ]
        },
        "_shard": "string",
        "_node": "string",
        "_routing": "string",
        "_source": {},
        "_rank": 42.0,
        "_seq_no": 42.0,
        "_primary_term": 42.0,
        "_version": 42.0,
        "sort": [
          42.0
        ]
      }
    ],
    "max_score": 42.0
  },
  "aggregations": {},
  "_clusters": {
    "skipped": 42.0,
    "successful": 42.0,
    "total": 42.0,
    "running": 42.0,
    "partial": 42.0,
    "failed": 42.0,
    "details": {
      "additionalProperty1": {
        "status": "running",
        "indices": "string",
        "": 42.0,
        "timed_out": true,
        "_shards": {
          "failed": 42.0,
          "successful": 42.0,
          "total": 42.0,
          "failures": [
            {}
          ],
          "skipped": 42.0
        },
        "failures": [
          {
            "index": "string",
            "node": "string",
            "reason": {},
            "shard": 42.0,
            "status": "string"
          }
        ]
      },
      "additionalProperty2": {
        "status": "running",
        "indices": "string",
        "": 42.0,
        "timed_out": true,
        "_shards": {
          "failed": 42.0,
          "successful": 42.0,
          "total": 42.0,
          "failures": [
            {}
          ],
          "skipped": 42.0
        },
        "failures": [
          {
            "index": "string",
            "node": "string",
            "reason": {},
            "shard": 42.0,
            "status": "string"
          }
        ]
      }
    }
  },
  "fields": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "max_score": 42.0,
  "num_reduce_phases": 42.0,
  "profile": {
    "shards": [
      {
        "aggregations": [
          {
            "breakdown": {},
            "description": "string",
            "type": "string",
            "debug": {},
            "children": [
              {}
            ]
          }
        ],
        "cluster": "string",
        "dfs": {
          "statistics": {
            "type": "string",
            "description": "string",
            "time": "string",
            "breakdown": {},
            "debug": {},
            "children": [
              {}
            ]
          },
          "knn": [
            {}
          ]
        },
        "fetch": {
          "type": "string",
          "description": "string",
          "": 42.0,
          "breakdown": {
            "load_source": 42.0,
            "load_source_count": 42.0,
            "load_stored_fields": 42.0,
            "load_stored_fields_count": 42.0,
            "next_reader": 42.0,
            "next_reader_count": 42.0,
            "process_count": 42.0,
            "process": 42.0
          },
          "debug": {
            "stored_fields": [
              "string"
            ],
            "fast_path": 42.0
          },
          "children": [
            {}
          ]
        },
        "id": "string",
        "index": "string",
        "node_id": "string",
        "searches": [
          {
            "collector": [
              {}
            ],
            "query": [
              {}
            ],
            "rewrite_time": 42.0
          }
        ],
        "shard_id": 42.0
      }
    ]
  },
  "pit_id": "string",
  "_scroll_id": "string",
  "suggest": {
    "additionalProperty1": [
      {
        "length": 42.0,
        "offset": 42.0,
        "text": "string"
      }
    ],
    "additionalProperty2": [
      {
        "length": 42.0,
        "offset": 42.0,
        "text": "string"
      }
    ]
  },
  "terminated_early": true
}















































































Activate a user profile Added in 8.2.0

POST /_security/profile/_activate

Create or update a user profile on behalf of another user.

NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions. Individual users and external applications should not call this API directly. The calling application must have either an access_token or a combination of username and password for the user that the profile document is intended for. Elastic reserves the right to change or remove this feature in future releases without prior notice.

This API creates or updates a profile document for end users with information that is extracted from the user's authentication object including username, full_name, roles, and the authentication realm. For example, in the JWT access_token case, the profile user's username is extracted from the JWT token claim pointed to by the claims.principal setting of the JWT realm that authenticated the token.

When updating a profile document, the API enables the document if it was disabled. Any updates do not change existing content for either the labels or data fields.

application/json

Body Required

  • The user's Elasticsearch access token or JWT. Both access and id JWT token types are supported and they depend on the underlying JWT realm configuration. If you specify the access_token grant type, this parameter is required. It is not valid with other grant types.

  • grant_type string Required

    Values are password or access_token.

  • password string

    The user's password. If you specify the password grant type, this parameter is required. It is not valid with other grant types.

  • username string

    The username that identifies the user. If you specify the password grant type, this parameter is required. It is not valid with other grant types.

Responses

POST /_security/profile/_activate
curl \
 -X POST http://api.example.com/_security/profile/_activate \
 -H "Content-Type: application/json" \
 -d '{"access_token":"string","grant_type":"password","password":"string","username":"string"}'
Request examples
{
  "access_token": "string",
  "grant_type": "password",
  "password": "string",
  "username": "string"
}
Response examples (200)
{
  "uid": "string",
  "user": {
    "email": "string",
    "full_name": "string",
    "realm_name": "string",
    "realm_domain": "string",
    "roles": [
      "string"
    ],
    "username": "string"
  },
  "data": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "labels": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "enabled": true,
  "last_synchronized": 42.0,
  "_doc": {
    "_primary_term": 42.0,
    "_seq_no": 42.0
  }
}




















Change passwords

PUT /_security/user/{username}/_password

Change the passwords of users in the native realm and built-in users.

Path parameters

  • username string Required

    The user whose password you want to change. If you do not specify this parameter, the password is changed for the current user.

Query parameters

  • refresh string

    If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.

    Values are true, false, or wait_for.

application/json

Body Required

  • password string
  • A hash of the new password value. This must be produced using the same hashing algorithm as has been configured for password storage. For more details, see the explanation of the xpack.security.authc.password_hashing.algorithm setting.

Responses

  • 200 application/json

    Additional properties are allowed.

PUT /_security/user/{username}/_password
curl \
 -X PUT http://api.example.com/_security/user/{username}/_password \
 -H "Content-Type: application/json" \
 -d '{"password":"string","password_hash":"string"}'
Request examples
{
  "password": "string",
  "password_hash": "string"
}
Response examples (200)
{}