-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Elasticsearch pagination does not work on 2.3.3 #25038
Comments
Hi @piotrusin. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @piotrusin do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @krishprakash. Thank you for working on this issue.
|
Hi @piotrusin. Thank you for your report. |
@krishprakash i don't get how those two are related besides that both issues are related to elasticsearch. in this case there is no exception thrown, just empty result set due to duplicated limit/offset |
There is a patch for this, but it will also cause the pager to stop showing: example Instead of "Items 1-9 of 13" just "13 Items" |
I've handled it by myself by adding before/after _loadEntities plugin on |
I have the same issue after upgrading to m2.3.3. - in all category pages or search results i am unable to click on the next page! |
btw this is also with elasticsearch 5x... not just 6x like the patch suggests |
Hello @piotrusin Thank you for contribution and collaboration! The hotfix for this Issue is published and available for download on magento.com portal here https://magento.com/tech-resources/download#download2331 Could you please apply patch and confirm that the issue is fixed? |
@sdzhepa can confirm that the hotfix works! Just to add - the error ist not just for eastic 6.x but also 5.x |
@simonmaass Did the pagination still work after applying the patch? When I apply the patch it breaks it. |
Obviously this has been closed and marked as fixed, but with Elastic Search enabled and Magento 2.3.3, it breaks pagination for me period. Even on non-search pages, (so just category/catalog pagination in general) - I applied the patch, triple checked the edit and regenerated files and all that but the pagination remains broken. If I switch to MYSQL search, pagination goes back to working immediately as expected. Edit: I have also noticed that category ordering does not work at all with Elastic enabled. |
Same as @ArthurSCD. I have applied the patch, the issue still there... @ArthurSCD have you found a solution? Please reopen this issue. |
Unfortunately no. I discovered part of the issue is related to One Column layouts as well. Even in a Vanilla M 2.3.3. On one live Magento I was forced to change to MYSQL search again for now as with Elastic enabled, the layered navigation added by the theme completely broke. And by broke I mean a mostly white page and some broken text. Relevant: |
I can confirm, @piotrusin temporary fix is working fine: etc/frontend/di.xml
Plugin\Collection
|
@piotrusin thank you for sharing your temporary fix. Applying before and after plugins work great. However, when we applied the plugins globally (i.e. placed the di.xml in the etc directory of our module), we discovered that the product tables in the adminhtml were broken (as described here #25555). For those who want to apply this temporary fix manually, make sure to apply the plugin(s) only in the frontend area (i.e. place the di.xml in the etc/frontend directory of your module) as suggested by @CRYX2 in #25038 (comment)). |
Hello everyone! |
Issue is reproducible if some custom module loads collection before
|
✅ Confirmed by @engcom-Golf |
✅ Confirmed by @engcom-Golf Issue Available: @engcom-Golf, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Hi @urvashikrish. Thank you for working on this issue.
|
Maybe I want to ask magento architecture this is a right way to use ListProduct Catalog Block. I have checked that original issue has been fixed on 2.4-develop branch. |
@magento give me 2.3-develop instance |
Hi @santosh-gaggle. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
does anybody fix this issue on 2.3? |
Hi @piotrusin. Thank you for your report and collaboration! The related internal Jira ticket But if you still run into this problem please update or provide additional information/steps/preconditions in the Description section and reopen this issue. |
Preconditions (*)
Magento version 2.3.3
Elasticsearch 6.0
Stores->Configuration->Catalog->Catalog->Catalog Search->Search Engine = Elasticsearch 6.0+
Steps to reproduce (*)
NEW steps used for REOPEN on
2.4-develop
-> #25038 (comment)Expected result (*)
Products from the second page are displayed.
Actual result (*)
No products found.
More details
I've digged up in Magento's ES implementation and found really strange thing. Magento is requesting elasticsearch with
from
andsize
parameters that limits search results but additionally there is another limit in \Magento\Eav\Model\Entity\Collection\AbstractCollection::_loadEntities$this->getSelect()->limitPage($this->getCurPage(), $this->_pageSize);
Result is as follow for second page of category listing:
from
andsize
and magento is adding product IDs to the collection.Example ElasticSearch request:
_loadEntities
and add yet another limit which goes way out of collections range and this leads to 0 results found.
The text was updated successfully, but these errors were encountered: