-
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
Product name wise sorting not working #36076
Comments
Hi @sunilit42. Thank you for your report.
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
For more details, review the Magento Contributor Assistant documentation. Add a comment to assign the issue: To learn more about issue processing workflow, refer to the Code Contributions.
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento give me 2.4-develop instance - upcoming 2.4.x release |
Hi @sunilit42. Thank you for your request. I'm working on Magento instance for you. |
Hi @sunilit42, here is your Magento Instance: https://8bd2bc0e66d0bd3b966a084f6762b575.instances.magento-community.engineering |
Hi @engcom-November. Thank you for working on this issue.
|
@magento give me 2.4-develop instance |
Hi @engcom-November. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-November, here is your Magento Instance: https://8bd2bc0e66d0bd3b966a084f6762b575.instances.magento-community.engineering |
Hi @sunilit42 , Thank you for reporting and collaboration. |
Check this line , here is bug if we enter name store wise name, coding doing sorting based on global name i found that issue with EE endition and here may be also |
@magento I am working on this |
Hi @mirianfalconi! 👋 |
@magento add to contributors team |
Hi @mirianfalconi! 👋 |
@magento add to contributors team |
@magento I am working on this |
Verified the issue again on Magento 2.4-develop instance but observed below different issue on Admin - Categories page.
|
✅ Jira issue https://jira.corp.adobe.com/browse/AC-6766 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-November. Thank you for verifying the issue. |
@magento I am working on this |
@magento I am working on this |
I ran into this issue as well. To provide additional detail, the problem with the name sort is that it joins the catalog_product_entity_varchar table in a way that can produce multiple rows for the same product in the final query. On my Magento installation we have 3 websites and lots of products have ended up with name values at the default scope and all 3 website scopes. The final query executed in \Magento\Elasticsearch\Model\ResourceModel\Fulltext\Collection\SearchResultApplier::categoryProductByCustomSortOrder expects to return 12 distinct product ids, but due to joining the scoped names, it returns these 12 rows (where what appear to be duplicates are actually different store ids):
As a result, only 518, 270, and 414 are returned, and only those 3 products show on the page. The solution here will be to properly group the query so only 1 row per entity id is returned, though that will be complicated by the need to include the product name for the proper scope for each product. While not an actual fix for this issue, I worked around it on my installation by completely circumventing the logic with the flawed query. I patched Magento\Elasticsearch\Model\ResourceModel\Fulltext\Collection\SearchResultApplier and replaced this:
with this:
This removes the logic that's trying to show all in stock products before all the out of stock products, and it instead uses the results from Elasticsearch directly without running the additional query containing the bug. |
Hi @sunilit42 , Thanks for your reporting and collaboration. Steps to reproduce
Can you please re-verify and confirm if you are still facing the issue. |
Preconditions and environment
Steps to reproduce
Expected result
Actual result
Additional information
No response
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: