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

Add The Ability To Limit Autocomplete Results #11572

Merged

Conversation

@mpchadwick
Copy link
Contributor

@mpchadwick mpchadwick commented Oct 20, 2017

Description

Adds the ability to limit the number of results in the search autocomplete. Defaults to 8

image

Manual testing scenarios

  1. In the admin create a product called "Elephantawesomepants"
  2. On the frontend search for "Ele", "Elep", "Eleph", etc... until you've passed the default limit
  3. Notice that no more than the configured limit of search terms are displayed

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)
@mpchadwick mpchadwick changed the title Feature/autocomplete limit Add The Ability To Limit Autocomplete Results Oct 20, 2017
@vrann vrann self-assigned this Oct 20, 2017
@vrann vrann added this to the October 2017 milestone Oct 20, 2017
@vrann vrann added the develop label Oct 20, 2017
@magento-engcom-team magento-engcom-team changed the base branch from develop to 2.3-develop Oct 20, 2017
@vrann
Copy link
Contributor

@vrann vrann commented Oct 24, 2017

@mpchadwick Note from our QA:

It looks like something is broken after this fix.

I have these products: catalog_product_20171024_082043.csv.zip

image1

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.
image2

And what is really weird is what we see on 2.3-develop:
image3

Loading

@mpchadwick
Copy link
Contributor Author

@mpchadwick mpchadwick commented Oct 25, 2017

@vrann

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...

  1. Import the product set provided (catalog_product_20171024_082043.csv.zip)
  2. Type "elep" into the search field in the admin panel
  3. Delete "elep" and unfocus the form field

You will get the error at this point

Loading

@vrann
Copy link
Contributor

@vrann vrann commented Oct 25, 2017

@mpchadwick got it, makes sense. Thank you for the explanation!

Loading

@okorshenko okorshenko removed this from the October 2017 milestone Nov 1, 2017
@okorshenko okorshenko added this to the November 2017 milestone Nov 1, 2017
@okorshenko okorshenko removed this from the November 2017 milestone Dec 1, 2017
@okorshenko okorshenko added this to the December 2017 milestone Dec 1, 2017
@okorshenko okorshenko removed the 2.3.x label Dec 14, 2017
@okorshenko okorshenko removed this from the December 2017 milestone Jan 8, 2018
@okorshenko okorshenko added this to the January 2018 milestone Jan 8, 2018
@okorshenko okorshenko removed this from the January 2018 milestone Feb 7, 2018
@okorshenko okorshenko added this to the February 2018 milestone Feb 7, 2018
@okorshenko okorshenko assigned okorshenko and unassigned vrann Feb 8, 2018
@magento-engcom-team
Copy link
Contributor

@magento-engcom-team magento-engcom-team commented Feb 8, 2018

@mpchadwick thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

Loading

@okorshenko
Copy link
Contributor

@okorshenko okorshenko commented Feb 27, 2018

Hi @mpchadwick
Could you please resolve code conflicts so that we can proceed with the PR acceptance?

Loading

@mpchadwick
Copy link
Contributor Author

@mpchadwick mpchadwick commented Feb 28, 2018

@okorshenko done

Loading

@magento-engcom-team magento-engcom-team merged commit 5e24861 into magento:2.3-develop Feb 28, 2018
2 of 3 checks passed
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants