cancel
Showing results for 
Search instead for 
Did you mean: 

Can we disable Elasticsearch from magento 2.4???

SOLVED

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

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

15 REPLIES 15

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!

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 ???

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

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.

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 !

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.

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


@gaurav_harsh1 wrote:

@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 !


The question is not about new, better design plan (please, do not be sarcastic on this) but what was the problem with earlier design with letting admins/developers to choose other (even totally free) search engines for their catalog search? The question more like about what was the problem with the earlier design from users viewpoint? That users had choices on catalog search solutions? Or the problem was more development time for providing api for other search solutions too as it was earlier? Elasticsearch requires a monthly payment, mandatory to run that,. Well, there is a 14 days free trial first (please, correct me if I am wrong on that). So you can download and test magento, but if you do not pay for elasticsearch then you can finish testing/using magento after 14 days. Great design I have to say. Or does adobe has a stake in elasticsearch and that is why it is the only option to use for search within magento. Magento cannot even start without elasticsearch. it looks like a hidden, mandatory sale of another product for me, but I just wanted to test and study magento... I'm from other frameworks and just tried to look into Magento a bit, and I am not even the "I like free products" guys, it is not about that... well, I can conclude that Magento is an Interesting design and framework at first glance. ...And, yes, there are many better design options regarding this question. And finally, probably many of us could contribute to the development of this framework but we are not even adobe or elasticsearch employees, and making the setup like described above will stop the arriving of new free contributors to this. That is one design question on this I think if we consider the future... no complain at all, I just wanted to share my thoughts on this here.

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

I don't know what Adobe motives for choosing ElasticSearch are. Possibly they didn't want to support more than one search engine and split dev time. Choosing one platform is going to lead to more focused efforts for squashing bugs and so forth.

 

I do agree it's cumbersome to have to run additional servers. Especially if you are a student or running a container environment.

 

You can run ElasticSearch for free https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html

 

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

Yes & No

 

Yes, you can stop ES at the OS level if you are using a special built server that makes use of the B24 module developed by a 3rd party. [Magento 2.4+ OSE only].

 

And if not...

 

No, as ES needs to be installed and available for various Mage module components to function.

 

Demo here: https://demo.awsamistacx.com     
ES is NOT running on this server, and it is Magento 2.4.2