Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.4.5-p1 Search Slow - show_out_of_stock enabled #2772

Closed
timpea opened this issue Nov 8, 2022 · 6 comments
Closed

2.4.5-p1 Search Slow - show_out_of_stock enabled #2772

timpea opened this issue Nov 8, 2022 · 6 comments

Comments

@timpea
Copy link

timpea commented Nov 8, 2022

When Show Out Of Stock products in enabled, search with ElasticSuite is very slow

Preconditions

Magento Version : CE 2.4.5-p1
ElasticSuite Version : 2.10.12.1
Environment : Production

Steps to reproduce

  1. Configuration>Catalog>Inventory>Stock Options>Display Out Of Stock Products: YES
  2. Slow search on front end

Same issue occurs using default ElasticSearch 7, the speed issue can be solved with this fix:
magento/magento2#36375

With ElasticSuite enabled, the above fix does not affect the load speed and it is still extremely slow.

@vahonc
Copy link
Collaborator

vahonc commented Nov 9, 2022

Hello @timpea

How many products on your store?

BTW, displaying Out Of Stock Products it's a Magento native feature, therefore I'm not sure that the issue with slow search is ElasticSuite's fault. When we tested the compatibility of our module with Magento 2.4.5 we detected some problems with Display Out Of Stock Products when it was set to YES. And it looks like this issue occurred on the Magento side after implementing some breaking changes exactly in the 2.4.5 version.

On the GitHub of Magento, already exists a few issues are linked to this problem. For example, this issue. As you can see there are some fixes but they don't solve problems for all.

BR,
Vadym

@timpea
Copy link
Author

timpea commented Nov 9, 2022

Hi Vadym,

We have 17956 products, 11027 enabled.
2396 are out of stock.

Thank you, I have been following the Magento GitHub issues. I was hoping you might have a clue for a temporary fix for the search speed. I thought I had cracked it when I saw magento/magento2#36375, but this didn't help with ElasticSuite.

The popup quick search is working fine.

Many Thanks
Tim

@romainruaud
Copy link
Collaborator

This is the original issue on Magento side : magento/magento2#36055

And the associated fix : magento/magento2#35986 (hello @Bashev !)

For me, this fix will not have an effect when using Elasticsuite.

There is also this issue that is still opened by their side : magento/inventory#3360

I'll have a look about what we can do.

@romainruaud
Copy link
Collaborator

@timpea can you check if this PR solves your issue ? #2774

In fact, we do not need the dirty plugin added in Magento Inventory, Elasticsuite is already building properly the total number of displayed products, wether we want to display out of stock products or not. So the easier fix is to remove this plugin.

You can checkout the PR locally, or just disable the plugin through code in your project.

Let me know if this does the job.

Regards

@timpea
Copy link
Author

timpea commented Nov 10, 2022

Perfect, just tested on our staging server and it has fixed the incorrect numbers of displayed products, and it has reduced the page load from 6sec to under 2sec.

@romainruaud
Copy link
Collaborator

Great, then I'll merge this, and maybe I'll tag a "minor minor" release because this bug is annoying for many people.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants