If your Elasticsearch Index status is yellow or red, it means that the performance of your Magento 2 website is reduced. However, you can quickly restore it by applying the following fix that describes how to reset the green Elasticsearch Index Status. You can find other useful tips here: Magento 2 Cookbook.'
The yellow color of the Elasticsearch Index Status indicates average productivity, while the red one speaks for lousy performance. The problem is common for Magento Commerce and Cloud versions 2.2.x and 2.Let’s Let’s see why the Elasticsearch catalog search index slows down.
Although there may be different potential causes, there is one that leads to this situation more often. The disk space is not enough for the Elasticsearch instance. As a result, it cannot run regularly, reducing performance.
Below, we provide six simple steps that describe how to restore the green Elasticsearch Index Status in Magento 2. Follow this guide to fix this issue:
- First of all, you need to switch to the MySQL search from Elasticsearch. Enable the former in settings.
- Now, it is necessary to identify duplicated indexes. You can do that by running this command:
1curl --silent -X GET localhost:9200/_cat/indices?v
- Now, when unnecessary indexers are defined, you can get rid of them. Use the following command to delete them and get some free space:
1curl -XDELETE localhost:9200/[your_index_name_here]
- Now, it is time to switch back to Elasticsearch. Reenable it in settings.
- After that, you have to run a full reindex. This step lets you use Elasticsearch again.
- Check the Elasticsearch Index Status via the following command (it should be green now):
1curl -m1 localhost:9200/_cluster/health?pretty