Skip to content

runners: make results more relevant

This is a combination of several adjustments in an effort to make KRunner results more relevant, addressing some related bugs (most notably https://bugs.kde.org/show_bug.cgi?id=459516 and https://bugs.kde.org/show_bug.cgi?id=340283#c19) concerning the order of matches among the various workspace runners. In short, recent document and web URL matches tend to be too strong, and application, system settings and Baloo matches too weak. Mostly this boils down to an imbalance in how the different runners flag their results as exact vs. possible matches, as this is what primarily (with higher priority than the relevance value) determines their ranking in Milou, as far as I understand (correct me if I'm wrong). This combination of commits adjusts the match types and relevances in some of the workspace runners to make them play together more usefully.

  • In the services runner, set the type to exact match rather than possible match if the query exactly matches the service name.
  • In the Baloo runner, set the type to exact match rather than possible match if the query exactly matches the file name with or without the file extension.
  • In the system settings runner, set the type to exact match rather than completion match if the query exactly matches the KCM name or one of the keywords: systemsettings!165 (merged).
  • In the locations runner, set the type to possible match rather than exact match (default) if the URL is not a file known to exist. This prevents (non-existent) locations such as "https://text.txt" form being ranked higher than an exact file name match with an existing file. Also remove a duplicate line.
  • In the recent documents runner, start with relevance 0.75 and stepwise decrease the relevance by 0.05 as files get less recent, instead of giving all files a relevance of 0.5. When the file name exactly matches or starts with the query, boost the relevance a little less than currently. When checking for exact and starting match, check for with and without the file extension, and case-insensitive. This allows for closely matching recent files to still be ranked higher than non-recent files from Baloo, but not higher than an exactly matching application name.

Prominent examples:

  1. Search term: "konsole"; Desired result: application

Before: The Konsole application does not even appear at all, top results are spammed with recent files, half of which are only vaguely relevant konsole_before After: Applications are at the top konsole_after

  1. Search term: "config.md"; Desired result: file

Before: Top match is a non-existent web location; the desired file never makes it to the top even with a high launch count booster config_before After: Top match is the file config_after

BUG: 459516 CCBUG: 340283

Edited by Natalie Clarius

Merge request reports