get_index_stats
Retrieve per-index size, fragmentation, and scan traffic to identify which index drives disk or memory pressure, using hierarchical bucket, scope, collection, and index filters.
Instructions
Get per-index statistics (size, fragmentation, scan traffic) from the Index Service.
Names which index is responsible for disk or memory pressure — use it after get_cluster_metrics shows a node's index disk climbing.
Filters are hierarchical: scope requires bucket, collection requires both, index requires all three. No filters returns every index in the cluster.
Returns nodes (keyed by node, each with an indexer block and an
indexes list of bucket/scope/collection/name + stats),
nodes_without_index (nodes that answered but do not hold the requested
index — expected, since an index lives only where it was placed) and
nodes_failed (nodes that could not be reached, so a partial answer is
visible as one). indexer is None for filtered calls.
Numbers are per node. A partitioned index appears under several nodes, each
reporting only its own share: sum items_count/data_size/disk_size
across nodes, but not num_requests, which every hosting node counts in
full.
Reading the stats: disk_size far above data_size (see
frag_percent) means space reclaimable by compaction; num_requests
with last_known_scan_time (Unix ns, 0 = never) identifies unused
indexes; num_docs_pending is indexing lag. Counters reset when the
indexer restarts, so a low count alone does not prove an index is unused.
skip_empty=True drops zero-valued fields (~two thirds on an idle
cluster) — leave it False when hunting unused indexes, since it also removes
num_requests: 0.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index_name | No | ||
| scope_name | No | ||
| skip_empty | No | ||
| bucket_name | No | ||
| collection_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||