Skip to content

Search enum member strip fallback#402

Merged
lucatorella merged 3 commits into
mainfrom
search-enum-member-strip-fallback
Jul 23, 2026
Merged

Search enum member strip fallback#402
lucatorella merged 3 commits into
mainfrom
search-enum-member-strip-fallback

Conversation

@eugenia-scandit

Copy link
Copy Markdown
Collaborator

No description provided.

eugenia-scandit and others added 2 commits July 17, 2026 15:53
When a query names a framework/version, we route on it (framework filter in
transformItems, version facet rewrite) but previously left the token in the
query text sent to Algolia. That platform word skewed textual relevance -
e.g. "barcode capture flutter" lifted /sdks/flutter/agent-skills/ (which lists
frameworks) above /sdks/flutter/barcode-capture/get-started/.

Strip the detected framework tokens (and the version marker when it routes)
from the query text only. Routing is unchanged - it's still derived from the
original query (latestQueryRef and versionTagInQuery both read the original);
only the text Algolia scores against differs, so the product's main guide
surfaces instead of a framework-listing page. Keep the original query if the
strip would empty it (e.g. a lone "ios").

Verified before/after on the framework/version query set: get-started and
product intro pages now rank first where framework-listing / release-notes
pages did before.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ro results

Exact enum-member queries like "rectangularviewfinderstyle.legacy" return zero
because the member has no page of its own - it's documented on the parent
symbol's page. Add stripTrailingMember() and, in the search client wrapper,
retry once with the trailing ".member" removed when the full query yields zero
hits, adopting the retry only when it actually finds results. Fires only on
zero-result single-token dotted queries, so normal searches are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve conflict in src/theme/SearchBar/index.js: main brought in the
strip-routed-tokens search-client work (effectiveRequests); this branch's
buildRequests generalizes it and adds the enum-member zero-result retry, so the
resolution keeps buildRequests + stripTrailingMember (a superset of main's
logic - no behavior from main is lost) alongside all other main changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lucatorella
lucatorella merged commit e04cc88 into main Jul 23, 2026
2 checks passed
@lucatorella
lucatorella deleted the search-enum-member-strip-fallback branch July 23, 2026 12:26
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