elasticsearchHow do I list all the indexes in Elasticsearch?
To list all the indexes in Elasticsearch, you can use the _cat
API. The _cat
API provides a convenient way to interact with the cluster and retrieve information about the nodes, indices, and shards.
Example
$ curl -XGET 'localhost:9200/_cat/indices?v'
Output example
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open test_index XXXXXXXXXXXXXXXXXX 5 1 0 0 5.3kb 5.3kb
The _cat/indices
API provides the following information about each index:
health
: The health status of the index (green, yellow, or red).status
: Whether the index is open or closed.index
: The name of the index.uuid
: A unique identifier for the index.pri
: The number of primary shards in the index.rep
: The number of replica shards in the index.docs.count
: The number of documents in the index.docs.deleted
: The number of deleted documents in the index.store.size
: The size of the index in bytes.pri.store.size
: The size of the primary shards in bytes.
For more information, please refer to the Elasticsearch documentation.
More of Elasticsearch
- How do I use ElasticSearch to zip files?
- How can I use Elasticsearch and ZFS together?
- How can I use elasticsearch zone awareness to improve my software development?
- How do I configure the Xms and Xmx settings for Elasticsearch?
- How do I use Elasticsearch with ZGC?
- How do I set up an Elasticsearch Yum repository?
- How do I configure xpack.security.authc.realms in Elasticsearch?
- How can I use YouTube to learn about Elasticsearch?
- How can I perform a case-insensitive wildcard search using Elasticsearch?
- How can I use the Elasticsearch web UI to search my data?
See more codes...