Magento2 – Check and Set Current Elasticsearch Index

elasticsearchmagento2.3reindex

We have a large catalog (400k products) that takes a day or two to reindex.

Occasionally I've had something go wrong with the indexing process and then nothing is searchable (code errors). I don't want the site down for days if this happens, so I'd like to clone the current index, then start the Magento reindexing, and if something goes haywire, restore the backup index.

I can't find how to see/overwrite which version of the index is currently being used.

Best Answer

I found out that the index is specified by an alias in the actual query: magento2_product_1 in our case, which points to the current actual index: magento2_product_1_v38.

I can see the indexes by running this curl statement:

curl -X GET "localhost:9200/_cat/aliases?v=true&pretty"

Related Topic