How to get list of all Elasticsearch indices in Magento 2?

Magento 2 you can get a list of all indices available for the system, With the help of the CLI command, You can check the status of each indices used for the system.

You can run the given command,
curl -X GET http://localhost:9200/_cat/indices?v

If you have changed your elastic search hostname to something else, You need to replace localhost with your actual name.

For example, curl -X GET http://elasticsearch:9200/_cat/indices?v

You can get the result once the valid URL is available, On a success call, the result looks like this,

health status index                                                uuid                   pri rep docs.count docs.deleted store.size pri.store.size
green  open   magento_default_catalog_product_20230703_022952      bjHqWsUATpGg1xwnnB5YAg   1   0          0            0       283b           283b

With a list of available indices for the system in a response.
Health status green displays your indices status is healthy.