Skip to content

feat(search): index inline code - #555

Draft
caugner wants to merge 1 commit into
mainfrom
inline-code-index
Draft

caugner wants to merge 1 commit into
mainfrom
inline-code-index

Conversation

@caugner

@caugner caugner commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add a separate field for visible inline <code> spans, with exact syntax and identifier-prefix indexing.

Motivation

Make technical syntax searchable while preserving existing prose recall and excluding <pre> examples from inline-code relevance.

Additional details

Dex builds the mdn_docs index; Rumba owns production search in mdn/rumba, src/api/search.rs::do_search. Fred calls /api/v1/search, which Dex proxies to Rumba. Rumba currently boosts title matches by 5 and body matches by 1, adding title phrase matches at 10 and body phrase matches at 2 for queries containing spaces. The default best sort also adds popularity with a factor of 10 and boost_mode: sum.

Add these clauses to Rumba's existing subqueries list, retaining the title, body, and phrase clauses:

{ "term": { "inline_code.exact": { "value": "<query>", "boost": 20.0 } } }
{ "match": { "inline_code.partial": { "query": "<query>", "boost": 5.0 } } }

Rumba's typed query serializer in src/api/elastic.rs also needs a term query variant and an inline-code partial match variant that serialize the dotted field names. The Dex index change alone does not change production matching or ranking until Rumba adds these clauses.

Related issues and pull requests

This branch has not been deployed

No deployments
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