-
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
Weight Link UI search results slightly towards Posts #67563
base: trunk
Are you sure you want to change the base?
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @shuttermuse. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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: +11 B (0%) Total Size: 1.83 MB
ℹ️ View Unchanged
|
Flaky tests detected in 42b19eb. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12273876269
|
packages/core-data/src/fetch/__experimental-fetch-link-suggestions.ts
Outdated
Show resolved
Hide resolved
eb80764
to
904c819
Compare
* score between 0 and 1, where 1 is a perfect match. | ||
* We sort by scoring each result, where the score is a combination of the number of exact matches | ||
* and sub-matches for tokens in the title that are also in the search query, divided by the total | ||
* number of tokens in the title. This gives us a score between 0 and 1, where 1 is a perfect match. |
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.
This gives us a score between 0 and 1, where 1 is a perfect match.
I don't fully understand the scoring logic yet, but the score can be greater than 1, right? Is the actual maximum score 10?
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.
Overall i can now be greater than 1. We could tweak the whole thing to keep scores below 1 if that helps?
904c819
to
962e489
Compare
What?
Weights the Link UI search results slightly towards Posts
Closes #67561 and #63683
Why?
In general Link UI search Posts are likely the most relevant results. Therefore slightly weighting towards them is important when sorting the results.
How?
Apply a slight weighting factor in favour of sorting for
kind: post-type
in search results.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast