Skip to content

Magento 2 – Get name or alias of indice ElasticSearch Product and Category

Is there a way to know what is the name or alias of the index created in elastic search in a custom module?

For example when i execute command line bin/magento indexer:reindex Magento change the names indices:

colecciones_local_orlcas_default_thesaurus_20230112_201128
colecciones_local_orlcas_default_catalog_category_20230112_201126
colecciones_local_orlcas_default_catalog_product_20230112_201117

I need to get the alias or name of indice product and indice category.

For some functions i use smile elasticsuite, but for specific new module i need custom query, because i need the indice name.

Thanks!