-
Notifications
You must be signed in to change notification settings - Fork 313
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
Feature: Did you mean #3425
Feature: Did you mean #3425
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@burhandodhy identified some changes we'll need to do but happy to talk about it next week.
Add option in feature WIP Improvements Minor changes Minor changes Add tests Minor changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@burhandodhy Can we also please add some documentation about how people can use this feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@burhandodhy some final changes we'll need to make before this can be merged. We also need to add somewhere that code is required to display the suggestions. Thoughts?
Also, I just noticed that the feature is auto-activating on existing installations and that is not something we can do on a minor release. Steps to reproduce:
- 10updocker wp option patch delete ep_feature_settings did-you-mean
- git checkout develop
- git checkout feature/2089
Description of the Change
This PR adds the 'Did you mean' functionality just like other search engines have. The algorithm on ES will detect any typos in the search term and based on the result, the most preferred term will be disabled. To add the functionality to the search page, the user has to call the function
\ElasticPress\Features::factory()->get_registered_feature( 'did-you-mean' )->get_suggestion();
Closes #2089
How to test the Change
\ElasticPress\Features::factory()->get_registered_feature( 'did-you-mean' )->get_suggestion();
on theme search template.This feature includes a setting that applies when the search results yield no matches.
Changelog Entry
Credits
Props @burhandodhy
Checklist: