Skip to content

Site search fails code-like queries (symbols, code tokens, stopwords, typos) #1972

Open

Description

@caugner

What information was incorrect, unhelpful, or incomplete?

Site search (/en-US/search) returns no results, or buries the canonical page, for queries that developers type as code:

  • Symbols and operators return zero results, even where the page title contains the symbol: % ("Remainder (%)"), !, ?, ~, *, @, #, !!, ${}, ::. The index strips punctuation, so these queries have no tokens left to match.
  • Code tokens in prose don't help ranking: max-age doesn't surface Cache-Control, and ::before, :has() or @media rank their reference pages low or not at all.
  • Exact API names that are stopwords return zero results: a (the <a> element) and then (Promise.prototype.then()).
  • Typos, plurals and compound words return zero results: adress, lenght, localcompare, eventlisteners, webworker.

In site search measurements from 4 weeks in September 2026, 22 of the 39 most frequent zero-result queries (about half of those searches) have a matching MDN page. Most of the rest are topics MDN doesn't cover, where zero results is correct.

What did you expect to see?

  • Symbol and operator queries find the operator, selector or syntax page (e.g. % → Remainder, ${} → Template literals, :: → pseudo-elements).
  • Code tokens rank the page that documents them first (e.g. max-age → Cache-Control).
  • Exact API names match, even when they are common words.
  • Near-miss spellings still find the intended page when the exact query has no results.
  • No regressions for plain-word queries (e.g. html, fetch and flexbox keep their current top results).

Do you have any supporting links, references, or citations?

Related to:

Do you have anything more you want to share?

A fix needs changes in both Dex (index fields) and Rumba (query):

  • Index inline code, and add title fields that keep punctuation.
  • Apply the inline-code and symbol matching only to code-like queries, so plain-word queries are unaffected.
  • Add a fallback query (fuzzy matching, exact API names) that runs only when the main query returns no results.

In a local evaluation against the same measurements, this fixes 17 of the 22 queries above, with no measurable change to how high clicked results rank for other queries. The as-is version of mdn/rumba#885 regresses plain-word queries significantly, which is why the matching needs to depend on the query's shape.

The quick search in the header uses a separate client-side title index and is out of scope here.

Activity

  1. added
    needs triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.
    on Oct 1, 2026
  2. self-assigned this
    on Oct 1, 2026
  3. added
    p1We will address this soon and will provide capacity from our team for it in the next few releases.
    and removed
    needs triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.
    on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

p1We will address this soon and will provide capacity from our team for it in the next few releases.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions