How to delete Elasticsearch indices in Magento 2?

You can delete specific elastic search indices or all the available indices with the help of the Delete command.

You can run the given command to delete a specific index from the elastic search,

curl -X DELETE 'http://localhost:9200/<index_name>'

Continue reading “How to delete Elasticsearch indices in Magento 2?”

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.

How to Check Current Elasticsearch version in Magento 2?

You can check the current elastic search version installed in Magento 2 with the command line as well as from the admin panel.

If you want to check by Command Line,

php bin/magento config:show catalog/search/engine

The output will be: elasticsearch7 Continue reading “How to Check Current Elasticsearch version in Magento 2?”