How to restore green Elasticsearch Index Status in Magento 2

- Fire development, Magento 2

Magento 2 export CLI

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

Issue

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.

Solution

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:

  1. First of all, you need to switch to the MySQL search from Elasticsearch. Enable the former in settings.
  2. Now, it is necessary to identify duplicated indexes. You can do that by running this command:

  3. Now, when unnecessary indexers are defined, you can get rid of them. Use the following command to delete them and get some free space:

  4. Now, it is time to switch back to Elasticsearch. Reenable it in settings.
  5. After that, you have to run a full reindex. This step lets you use Elasticsearch again.
  6. Check the Elasticsearch Index Status via the following command (it should be green now):

For further information, follow this link: Elasticsearch Index Statu’ is yellow’ or ‘red.’