Skip to content
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

Merged
merged 2 commits into from
Apr 1, 2025
Merged

Conversation

hyunnaye
Copy link
Contributor

@hyunnaye hyunnaye commented Mar 24, 2025

Description
This PR adds the relevance sort back to the search page and adds it as default.

Screenshot example when searched for "test"
image

When set back to Most stars
image

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!

  • Check that your code compiles by running npm run build
  • Ensure that the PR targets the correct branch. Check the milestone or fix version of the ticket.
  • If this is the first time you're submitting a PR or even if you just need a refresher, consider reviewing our style guide
  • Do not bypass Angular sanitization (bypassSecurityTrustHtml, etc.), or justify why you need to do so
  • If displaying markdown, use the markdown-wrapper component, which does extra sanitization
  • Do not use cookies, although this may change in the future
  • Run npm audit and ensure you are not introducing new vulnerabilities
  • Do due diligence on new 3rd party libraries, checking for CVEs
  • Don't allow user-uploaded images to be served from the Dockstore domain
  • If this PR is for a user-facing feature, create and link a documentation ticket for this feature (usually in the same milestone as the linked issue). Style points if you create a documentation PR directly and link that instead.
  • Check whether this PR disables tests. If it legitimately needs to disable a test, create a new ticket to re-enable it in a specific milestone.

@hyunnaye hyunnaye self-assigned this Mar 24, 2025
Copy link

codecov bot commented Mar 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.78%. Comparing base (25007e3) to head (a73ce6f).
Report is 5 commits behind head on develop.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -128,11 +128,15 @@ export class SearchEntryTableComponent extends Base implements OnInit {
['categories.displayName', 'Category'],
]);
public defaultSortOption: SortOption = {
Copy link
Contributor

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

Copy link
Contributor

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...

Copy link
Member

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

Copy link
Contributor Author

@hyunnaye hyunnaye Mar 27, 2025

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

@hyunnaye hyunnaye requested a review from kathy-t March 31, 2025 16:04
@hyunnaye hyunnaye merged commit 7100d00 into develop Apr 1, 2025
19 of 20 checks passed
@hyunnaye hyunnaye deleted the feature/SEAB-6966 branch April 1, 2025 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants