Skip to content

EDU-17909 | Implement improvements to the search components#452

Open
anabaarbosa wants to merge 2 commits intomainfrom
searchcomponents
Open

EDU-17909 | Implement improvements to the search components#452
anabaarbosa wants to merge 2 commits intomainfrom
searchcomponents

Conversation

@anabaarbosa
Copy link
Copy Markdown
Contributor

What is the purpose of this pull request?

Centralizes tokenized search in src/utils/search/tokenizedSearch.ts: stopwords by locale, splitting the query into terms, matching on configurable fields, and ranking by how many terms match before applying date ordering.

Pages updated: known-issues, troubleshooting, faq, announcements. Each passes its own searchable fields:

Page Fields What each one represents
Known issues Title Problem name shown on the card and in the list.
  ID Internal KI reference (helps find an item by number/identifier even when it’s not in the title).
Troubleshooting Title Troubleshooting article title.
  Slug File/URL identifier (useful when the user remembers part of the link or filename).
FAQ Title FAQ question or title.
  Slug Article identifier in the URL.
  Product team Associated product team (supports matching by area, e.g. team name).
Announcements Title Announcement headline.
  Synopsis Locale-specific synopsis from frontmatter (when present).
  Tags (single string) Announcement tags concatenated into one searchable string (type, area, etc.).

Add a “?” tooltip next to the search inputs on those pages (reusing the known-issues tooltip message id with sensible defaultMessages).

Fixes Next.js 13 Image deprecation by replacing objectFit with style={{ objectFit: 'cover' }} in newsletter-section; removes unused unlink import in Cypress plugin; removes @img/sharp-linux-x64 from required deps (it broke yarn install on macOS arm64). If kept for Linux CI, it should live under optionalDependencies so local arm64 installs still succeed.

What problem is this solving?

List searches used a single substring on the title. That made multi-word queries and common words (articles/prepositions) awkward and did not rank results by relevance. This aligns behavior across content types with the richer KI-style flow and improves developer experience on Apple Silicon by not forcing a Linux-only Sharp binary as a hard dependency.

How should this be manually tested?

  1. yarn install and yarn dev on macOS arm64, install should complete (no @img/sharp-linux-x64 arch error if optional pattern is merged).
  2. For each locale (/pt/..., /en/..., /es/...), open Known issues, Troubleshooting, FAQ, and Announcements.
  3. Search with stopwords (e.g. “Admin login issue”), irrelevant words should be ignored; results should still match on remaining terms.
  4. Search with multiple words, items with more matching terms should rank higher; tie-break by the page’s date rule.

Screenshots or example usage

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires change to documentation, which has been updated accordingly.

- Remove @img/sharp-linux-x64; sharp resolves binaries per platform.
- Add utils/search/tokenizedSearch for terms, stopwords, and match counts.
- Use KI-style search on known-issues, troubleshooting, faq, announcements.
- Add search tooltips; fix Next Image objectFit in newsletter section.
- Remove unused unlink import from cypress plugins.
@anabaarbosa anabaarbosa self-assigned this Apr 20, 2026
@anabaarbosa anabaarbosa added effort-medium We estimate the effort to solve this issue is medium.. documentation Improve repository documentation. labels Apr 20, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 20, 2026

Deploy Preview for leafy-mooncake-7c2e5e ready!

Name Link
🔨 Latest commit f57012a
🔍 Latest deploy log https://app.netlify.com/projects/leafy-mooncake-7c2e5e/deploys/69e6451bab058400070c333c
😎 Deploy Preview https://deploy-preview-452--leafy-mooncake-7c2e5e.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

This pull request does not contain a valid label. Please add one of the following labels: ['release-no', 'release-auto', 'release-patch', 'release-minor', 'release-major']

@anabaarbosa anabaarbosa added release-no No release bump and removed effort-medium We estimate the effort to solve this issue is medium.. labels Apr 20, 2026
@anabaarbosa anabaarbosa requested review from karenkrieger and removed request for mariana-caetano April 29, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improve repository documentation. release-no No release bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant