-
Notifications
You must be signed in to change notification settings - Fork 16
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
SEAB-6966: add relevance sort in search #2071
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2071 +/- ##
========================================
Coverage 41.78% 41.78%
========================================
Files 390 390
Lines 12321 12321
Branches 2946 2946
========================================
Hits 5148 5148
Misses 4870 4870
Partials 2303 2303 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -128,11 +128,15 @@ export class SearchEntryTableComponent extends Base implements OnInit { | |||
['categories.displayName', 'Category'], | |||
]); | |||
public defaultSortOption: SortOption = { |
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.
When a user navigates to the search page on prod or when the user selects facets, the default sort appears to be by stars https://dockstore.org/search?entryType=workflows&searchMode=files and it's like that because ES returns it sorted by stars if there's no search term. The sort by relevance only shows up when there is a text search (basic or advanced).
In this PR, the default sort by relevance when there's no search term is really sorted by stars.
Not sure if it's worth differentiating this, but noting it and curious what others think
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.
Yeah, interesting dilemma. On the one hand, currently, we only really sort by "relevance" when there's a search term, so maybe the "Sort by Relevance" menu option doesn't make sense otherwise. On the other hand, someday, we may have a default non-search-term sort order that's relevance-based, using signals like usage, entries that we've chosen to feature, membership in categories/collections, etc.
When I first pondered this ticket, I figured we'd not display the "Sort by Relevance" menu option when there's no search term. For now, at least. However, might be tricky to implement...
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.
Not sure if it's worth differentiating this, but noting it and curious what others think
When I first pondered this ticket, I figured we'd not display the "Sort by Relevance" menu option when there's no search term. For now, at least. However, might be tricky to implement...
Agree with both, worth a try if easy, could ignore for now if not
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 tried to do this differentiation but is pretty tricky to implement.. Maybe we can leave it for now since the organisation search also doesn't say it's sorted by stars on default. https://qa.dockstore.org/organizations
Description
This PR adds the relevance sort back to the search page and adds it as default.
Screenshot example when searched for "test"

When set back to Most stars

Review Instructions
Go to the search page on qa and verify the relevance sort works
Issue
https://ucsc-cgl.atlassian.net/browse/SEAB-6966
Security
If there are any concerns that require extra attention from the security team, highlight them here.
Please make sure that you've checked the following before submitting your pull request. Thanks!
npm run build
markdown-wrapper
component, which does extra sanitizationnpm audit
and ensure you are not introducing new vulnerabilities