Skip to content

Y26-056 - Reduce search time#5616

Merged
BenTopping merged 7 commits intodevelopfrom
Y26-056-reduce-search-time
Mar 20, 2026
Merged

Y26-056 - Reduce search time#5616
BenTopping merged 7 commits intodevelopfrom
Y26-056-reduce-search-time

Conversation

@BenTopping
Copy link
Contributor

@BenTopping BenTopping commented Mar 17, 2026

Closes #5581

Changes proposed in this pull request

  • Adds new search option 'All (wildcard)' to maintain old search logic
  • Default search option to 'All' (non leading wildcard search). This dramatically improves performance as we can make use of indexes. This only affects Sample and Labware searches.
  • Adds index to labware name to improve search performance.
  • Fixes bug where bad user-input types (URL based) causes 500.

Notes

I have added an unused _wildcard to all for_search_query methods to keep the signatures the same even though its only used for Sample and Labware. It would be good to make use of this wildcard in the future as we are currently inconsistent with what is being wildcarded but that is out of scope for this story.

@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 80.95238% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.23%. Comparing base (780bbde) to head (229728a).
⚠️ Report is 8 commits behind head on develop.

Files with missing lines Patch % Lines
lib/informatics.rb 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5616   +/-   ##
========================================
  Coverage    87.22%   87.23%           
========================================
  Files         1461     1461           
  Lines        33003    33012    +9     
  Branches      3470     3472    +2     
========================================
+ Hits         28787    28797   +10     
+ Misses        4195     4194    -1     
  Partials        21       21           

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

@BenTopping BenTopping requested a review from StephenHulme March 18, 2026 10:20
@BenTopping
Copy link
Contributor Author

After discussion with @StephenHulme we decided not to abstract the wildcard/query layer to the search_behaviour class which would have added leading wildcard to all searches. This is because it would change the behaviour of some existing queries (adding wildcards) and cause issues with other queries (id queries) which is not intended in this PR.

Copy link
Contributor

@StephenHulme StephenHulme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the discussion and renaming :)

@BenTopping BenTopping force-pushed the Y26-056-reduce-search-time branch from 2762dd5 to 229728a Compare March 20, 2026 10:37
@BenTopping BenTopping merged commit b37ffd9 into develop Mar 20, 2026
41 of 42 checks passed
@BenTopping BenTopping deleted the Y26-056-reduce-search-time branch March 20, 2026 13:39
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.

Y26-056 - Reduce the loading time of search results

2 participants