#110661Live search: rank results by relevance across all providers
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
-
Gerrit Code Review pushed patch set 3 for main to change 94015 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-09T12:32:45+00:00" > 09/09/26, 12:32 </span> -
Gerrit Code Review pushed patch set 4 for main to change 94015 <span data-processor="relativetime" data-value="2026-09-09T13:41:39+00:00" > 09/09/26, 13:41 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 94015 <span data-processor="relativetime" data-value="2026-11-11T13:00:42+00:00" > 11/11/26, 13:00 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 94015 <span data-processor="relativetime" data-value="2026-11-19T12:38:20+00:00" > 11/19/26, 12:38 </span>