Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add The Ability To Limit Autocomplete Results #11572
Adds the ability to limit the number of results in the search autocomplete. Defaults to 8
Manual testing scenarios
@mpchadwick Note from our QA:
It looks like something is broken after this fix.
I have these products: catalog_product_20171024_082043.csv.zip
When I try to find 'ele' my autocomplete shows me that there are 10 products that match my search expression. We can type one mode letter and still should expect that there are 10 products that match my search expression, but autocomplete is not shown.
I'm not sure that your QA understands how the search autocomplete functions. The search autocomplete shows suggestions by finding previously run queries that contain the string that the user entered. If a user previously searched "ele" and re-types "ele", "ele" will show in the search autocomplete. If the user types "elep" but a search for "elep" has never happened before it will not show "elep" in the search autocomplete. If that user executes the search for "elep" the next time someone types "elep" into the search bar, it will show as an autocomplete suggestion.
Regarding the screenshot you shared from the admin panel, my change is not targeted at the search feature in the admin panel (in 4 years of working with Magento I don't think I've used that once). I was able to reproduce the red error message from the screenshot...however it was not introduced by my code an I could reproduce it after reverting my changes. The following reproduces reliably for me every time...
You will get the error at this point