Issue Feature Under Review

#110661Live search: rank results by relevance across all providers

Benjamin Kott 09/09/26, 09:00 updated 11/19/26, 12:38

Description

Problem

The backend live search asks every search provider in turn and
concatenates the results in provider order. Within a provider, records
come back ordered by uid, and the user interface then groups them by
record type.

Nothing in that chain looks at how well a record actually matches the
query. A page titled exactly like the search term ranks behind an
unrelated record that happens to carry a higher uid, and as soon as
there are more than a handful of hits, the best match can end up on the
last page.

Proposal

Rank results by relevance across all providers, so the records matching
a query best are on the first page regardless of which provider supplied
them.

  • Score a match in tiers: exact label match, label prefix, match at a
    word boundary, label substring, and a match in any other searchable
    field.
  • Let providers score and paginate at the data source, so only the
    records of the requested page are read in full. For the database
    providers that means an SQL expression, sorted and limited by the
    database.
  • Keep providers that do not opt in working. They are scored in PHP from
    the values they declare.
  • Replace the provider dropdown of the search form with filter tabs
    above the result list, one per provider plus “All”, each carrying its
    result count. Since ranking is global, the type headlines in the
    result list are no longer needed.

Impact

Editors get the best match first instead of paging through results
ordered by uid. Extension authors keep their existing providers
working, and can opt into database-side scoring and pagination.

Reviews 1

History 04