Skip to content

Fix curated resources search#737

Merged
richarddushime merged 5 commits intomasterfrom
fix-resource-search
Apr 8, 2026
Merged

Fix curated resources search#737
richarddushime merged 5 commits intomasterfrom
fix-resource-search

Conversation

@LukasWallrich
Copy link
Copy Markdown
Contributor

@LukasWallrich LukasWallrich commented Apr 8, 2026

Summary

  • Raised result limit from 30 to 500 — previously most matches were hidden with no way to see them
  • Enabled prefix matching for the last word in a query — e.g. "registra" now finds "registration", "pre-registra" finds "pre-registration" resources
  • Earlier words in multi-word queries still use full-word matching to keep results precise

Test plan

  • Search "pre-registra" — should return ~67 relevant pre-registration resources (was 48, with many hidden by the 30-item cap)
  • Search "registra" — should return ~45 results (was 0 due to whole-word matching)
  • Search "preregistration" — should return ~156 results (unchanged)
  • Search "open data" — should return ~822 results with relevant ones ranked first

🤖 Generated with Claude Code

…tching

The search was capped at 30 results (now 500), hiding most matches.
Also, search terms required exact whole-word matches — e.g. "registra"
wouldn't find "registration". Now the last word in a query uses prefix
matching while earlier words still require full-word matches, keeping
results relevant without noise.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@LukasWallrich LukasWallrich requested a review from a team as a code owner April 8, 2026 10:25
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

👍 All image files/references (if any) are in webp format, in line with our policy.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

📝 Spell Check Results

Found 1 potential spelling issue(s) when checking 3 changed file(s):

📄 themes/academic/assets/js/academic.js

Line Issue
100 collapsable ==> collapsible

ℹ️ How to address these issues:

  1. Fix the typo: If it's a genuine typo, please correct it.
  2. Add to whitelist: If it's a valid word (e.g., a name, technical term), add it to .codespell-ignore.txt
  3. False positive: If this is a false positive, please report it in the PR comments.

🤖 This check was performed by codespell

@LukasWallrich
Copy link
Copy Markdown
Contributor Author

LukasWallrich commented Apr 8, 2026

Staging Deployment Status

This PR has been successfully deployed to staging as part of an aggregated deployment.

Deployed at: 2026-04-08 12:27:09 UTC
Staging URL: https://staging.forrt.org

The staging site shows the combined state of all compatible open PRs.

LukasWallrich and others added 4 commits April 8, 2026 11:52
Previously each query word matched independently (OR), so "pre-registration"
returned more results than "registration" because "pre" matched extra items.
Now every query word must appear in an item for it to be included. Multi-word
phrases and prefix matching still contribute to ranking/weight.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Content normalization produces both forms (split and joined) for
hyphenated words. Query normalization strips hyphens so both
"pre-registration" and "preregistration" search identically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of loading index.json and rendering a separate results list,
the search input now filters the existing resource cards in-place via
isotope. Supports AND logic (all words must match), prefix matching,
and works alongside the category filter buttons. Shows a count of
matching resources.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Card text contains original hyphens, so searching "preregistration"
wouldn't find cards with "pre-registration". Now hyphens are stripped
from both the query (split to words) and card text (before matching).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@LukasWallrich
Copy link
Copy Markdown
Contributor Author

@richarddushime I think this is good to go - improves on #286 - could be further optimised, but it is now functional, and a more complex search can come when we search across resources

Copy link
Copy Markdown
Contributor

@richarddushime richarddushime left a comment

Choose a reason for hiding this comment

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

LGTM 👍

But this raises an extra issue that we can fix in a separate PR
at the bottom of the search results the section for Number of resources per FORRT Clusters
links are not working instead pointing to 404 page

Image

@richarddushime richarddushime merged commit 90e6efe into master Apr 8, 2026
5 checks passed
@richarddushime richarddushime deleted the fix-resource-search branch April 8, 2026 16:56
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.

2 participants