All methods and paths for this operation:
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.
Required authorization
- Index privileges:
monitor
Path parameters
-
A comma-separated list of index names; use
_allor empty string to perform the operation on all indices -
Comma-separated list of metrics used to limit the request.
Supported values include:
_all: Return all statistics.store: Size of the index in byte units.indexing: Indexing statistics.get: Get statistics, including missing stats.search: Search statistics including suggest statistics. You can include statistics for custom groups by adding an extragroupsparameter (search operations can be associated with one or more groups). Thegroupsparameter accepts a comma-separated list of group names. Use_allto return statistics for all groups.merge: Merge statistics.flush: Flush statistics.refresh: Refresh statistics.query_cache: Query cache statistics.fielddata: Fielddata statistics.docs: Number of documents and deleted docs not yet merged out. Index refreshes can affect this statistic.warmer: Index warming statistics.completion: Completion suggester statistics.segments: Memory use of all open segments. If theinclude_segment_file_sizesparameter istrue, this metric includes the aggregated disk usage of each Lucene index file.translog: Translog statistics.request_cache: Shard request cache statistics.recovery: Recovery statistics.bulk: Bulk operations statistics.shard_stats: Shard statistics, including the total number of shards.mappings: Mapping statistics, including the total count and estimated overhead.dense_vector: Total number of dense vectors indexed. Index refreshes can affect this statistic.sparse_vector: Total number of sparse vectors indexed. Index refreshes can affect this statistic.
Values are
_all,store,indexing,get,search,merge,flush,refresh,query_cache,fielddata,docs,warmer,completion,segments,translog,request_cache,recovery,bulk,shard_stats,mappings,dense_vector, orsparse_vector.
Query parameters
-
Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics.
-
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.Supported values include:
all: Match any data stream or index, including hidden ones.open: Match open, non-hidden indices. Also matches any non-hidden data stream.closed: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.hidden: Match hidden data streams and hidden indices. Must be combined withopen,closed, orboth.none: Wildcard expressions are not accepted.
Values are
all,open,closed,hidden, ornone. -
Comma-separated list or wildcard expressions of fields to include in fielddata statistics.
-
Comma-separated list or wildcard expressions of fields to include in the statistics.
-
If true, statistics are not collected from closed indices.
-
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.
-
Indicates whether statistics are aggregated at the cluster, indices, or shards level.
Values are
cluster,indices, orshards.
GET _stats/fielddata?human&fields=my_join_field#question
resp = client.indices.stats(
metric="fielddata",
human=True,
fields="my_join_field",
)
const response = await client.indices.stats({
metric: "fielddata",
human: "true",
fields: "my_join_field",
});
response = client.indices.stats(
metric: "fielddata",
human: "true",
fields: "my_join_field"
)
$resp = $client->indices()->stats([
"metric" => "fielddata",
"human" => "true",
"fields" => "my_join_field",
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_stats/fielddata?human&fields=my_join_field#question"
client.indices().stats(s -> s
.fields("my_join_field")
.metric("fielddata")
);