This article provides a patch for the known Magento issue, where the Advanced search does not show most relevant results first.
- Magento Commerce 2.X.X
- Magento Commerce Cloud 2.X.X
- Magento Open Source 2.X.X
The advanced search function is not returning the most relevant results first, like the quick search is doing. The issue does not depend on the selected search engine type.
Steps to reproduce:
- On the store front, go to the quick search and search for "Fitted Jacket".
- Notice "Orion Two-Tone Fitted Jacket" is the first result.
- Go to advanced search and search for "Fitted Jacket" in the name field.
The "Orion Two-Tone Fitted Jacket" is the first result when using Advanced search, as the most relevant result.
The "Orion Two-Tone Fitted Jacket" is not the first result, though it is the most relevant.
To solve the issue, apply the patch attached to this article. To download it, scroll down to the end of the article and click the file name, or click the following link:
The patch adds the implementation for sorting by relevance for advanced search results as the default sorting field.
The patch is compatible with all affected versions and editions.
How to apply the patch
We strongly recommend applying and testing the patch on the Staging/Integration environment, before applying it Production. We also recommend to have a recent backup before any manipulations.
How to apply this patch for Magento Commerce Cloud
- If you do not have a directory named
m2-hotfixesin the project root, please create one.
- Copy the
MDVA-7256_EE_2.1.7_v1.composer.patchfile(s) to the
Add, commit, and push your code changes:
git add -A && git commit -m "Apply MDVA-7256_EE_2.1.7_v1.composer.patch patch" && git push origin
How to apply this patch for Magento Commerce and Open Source
- Upload the patch to your Magento root directory.
- Run the following SSH command:
(If the above command does not work, try using
patch -p1 < MDVA-7256_EE_2.1.7_v1.composer.patch
- For the changes to be reflected, refresh the cache in the Admin under System > Cache Management.