-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve search relevance #8
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.
Wow, this looks great! Couple questions:
- Could you open an upstream PR in https://github.com/dbt-labs/dbt-docs, and reference it in
FORK.md
? - Did you explore the possibility of unit testing 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.
This improves search so much 🙌
Just some small comments, but it works perfectly!
I think we are just missing a changelog entry! other than that it looks good 🤩 |
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.
What was the latest result your exploration of unit-testing 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.
🚀
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.
🚀
Description
Problem and Solution
The assignSearchRelevance function goes through each result object and assigns a score based on certain criteria, using the following formula:
Although this method is effective, it introduces a problem. For example, when searching for the term dm_test in the data below, the entry dm_test_total ends up with a score of 19 (10 points from name + 9 points from description), while dm_test gets only 10 points.
To fix this, the pull request adds an additional step to the relevance calculation process. Now, a weight value is also computed and stored for the name field. Finally, the results are sorted first by overallNameWeight and then by overallWeight.
Checklist
changie new
to create a changelog entry