How to get current search engine enabled value Magento 2?

In Magento, You can get the value of the current enable search engine value programmatically.

You can set Search engine from the admin panel

To Retrieve the Current search engine value programmatically by interface, Magento\Framework\Search\EngineResolverInterface

Get value by the given syntax,

If you are on Magento 2.4 and don’t made any changes, your output will be elasticsearch7.

Elasticsearch7 is the Default Search Engine from the Magento 2.4

Output:
elasticsearch7

Leave a Reply