cancel
Showing results for 
Search instead for 
Did you mean: 

Can we disable Elasticsearch from magento 2.4???

SOLVED
Highlighted

Can we disable Elasticsearch from magento 2.4???

Hello Guys,

 

I try to install magento2.4 but it's required elasticsearch so, Is there any possible or patch to disable it ???

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Can we disable Elasticsearch from magento 2.4???

Hello @anantprajapati 

 

Magento has removed support for three deprecated catalog search engines: MySQL and Elasticsearch 2.x, 5.x, and 6.x. Merchants must install and configure a supported version of Elasticsearch before they upgrade to Magento 2.4. New installations require a connection to Elasticsearch to complete.

So prior installation, Elastic search should be configured on your server and should have active nodes to setup Magento.

 

PS: @Bhanu Periwal , they have completely removed MySQL for catalog search engines, no other way to change it for catalog search and this configuration was available in previous version only, removed from 2.4.

Problem Solved ? Click on 'Kudos' & Accept as Solution to encourage to write more answers !

View solution in original post

6 REPLIES 6
Highlighted

Re: Can we disable Elasticsearch from magento 2.4???

Hi @anantprajapati 

 

You can use the Magento 2 CLI to do it, you can check your current search engine using:

php -f bin/magento config:show catalog/search/engine

mysql.png

 

After that you can set to the default one using the config:set feature, like that:

php -f bin/magento config:set catalog/search/engine 'mysql'
It may help you!
Problem Solved? Please click on Kudos & Accept as Solution!
Highlighted

Re: Can we disable Elasticsearch from magento 2.4???

Hello @Bhanu Periwal  - It's asking me in installing time so, is it required to add option ???

Highlighted

Re: Can we disable Elasticsearch from magento 2.4???

Hello @anantprajapati 

 

Magento has removed support for three deprecated catalog search engines: MySQL and Elasticsearch 2.x, 5.x, and 6.x. Merchants must install and configure a supported version of Elasticsearch before they upgrade to Magento 2.4. New installations require a connection to Elasticsearch to complete.

So prior installation, Elastic search should be configured on your server and should have active nodes to setup Magento.

 

PS: @Bhanu Periwal , they have completely removed MySQL for catalog search engines, no other way to change it for catalog search and this configuration was available in previous version only, removed from 2.4.

Problem Solved ? Click on 'Kudos' & Accept as Solution to encourage to write more answers !

View solution in original post

Highlighted

Re: Can we disable Elasticsearch from magento 2.4???

No one answered this person's question.

They want to disable elasticsearch.

 

I'm in a similar boat. I do not want to run a Java server just to run Magento 2.4.x.

We are using a third party search provider, so there is a definite need to disable the search completely. As it stands, having no elasticsearch server running breaks the category pages.

 

Once again, poor development design.

Highlighted

Re: Can we disable Elasticsearch from magento 2.4???

@kmogged 

 

We believe that you got a better design plan and implementations, you can also contribute if you think something is not working correctly.

https://devdocs.magento.com/contributor-guide/contributing.html

 

As I already shared Elasticsearch is mandatory after M 2.4 release so it can't be disabled. Looking forward for your core contribution, Thank you !

Problem Solved ? Click on 'Kudos' & Accept as Solution to encourage to write more answers !
Highlighted

Re: Can we disable Elasticsearch from magento 2.4???

Sorry, I didn't mean to sound like a jerk. I just don't agree that reciting the Magento documentation is a solution. Even though Magento says something is required doesn't mean it can't be disabled via code or another hack.

 

Sadly, I don't have a great solution either. The easiest thing that can be done is using a hosted or self-hosted ElasticSearch server.

 

TLDR;

I was able to upgrade to Magento 2.4.1 by executing this command:

/usr/bin/php bin/magento config:set catalog/search/engine none

Most of the site functions except for category pages and search. I am not concerned with the search portion, but do require category pages to function as normal. If you didn't need these 2 page types, awesome!

 

After actually digging through the code and figuring out why Magento says it's required. I verified that the category pages are using the search engine to return the results of the page. The collection is using a query to the search engine, and not a query to the database. The answer is no it can't simply be disabled. Perhaps with heavy modification you could recreate the functionality that was removed.