-
Notifications
You must be signed in to change notification settings - Fork 4.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
Prefer exact matches in Link Search results sorting #67367
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +15 B (0%) Total Size: 1.83 MB
ℹ️ View Unchanged
|
cb1f593
to
92fa46f
Compare
Flaky tests detected in 92fa46f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12071514942
|
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.
I think this is great!
* Weight towards exact matches * Add additional test coverage Co-authored-by: getdave <get_dave@git.wordpress.org> Co-authored-by: draganescu <andraganescu@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: kevin940726 <kevin940726@git.wordpress.org> Co-authored-by: ironprogrammer <ironprogrammer@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org>
* Weight towards exact matches * Add additional test coverage Co-authored-by: getdave <get_dave@git.wordpress.org> Co-authored-by: draganescu <andraganescu@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: kevin940726 <kevin940726@git.wordpress.org> Co-authored-by: ironprogrammer <ironprogrammer@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org>
What?
Fixes Link search results sorting to sort in favour of exact search term matches over sub matches
Closes #38121
Why?
When searching for a Post it's important that results are ordered to weight towards exact matches. If we don't do this then we end up in situations where a search for "News" will return:
...even though both "News" pages are logically more relevant to the search term. Histroically this has lead to strange results as reported in the Issue..
How?
Updates the client-side search sorting/ordering algorithm to weight towards exact matches over sub matches. This means if a search term matches a title token exactly it [the result] will "score" more highly in the weighting.
Testing Instructions
Testing Instructions for Keyboard
News
Newspaper
News Flash News
News
Screenshots or screencast