Skip to content

runner: increase match type when kcm name or keyword exactly matches query

Natalie Clarius requested to merge (removed):runner-exactmatch into master

Increase the match type when the query exactly or closely matches the values:

  • When the name, generic name or description of a KCM exactly matches the search term, set the match type to exact match rather than completion match.
  • When the name, generic name or description of a KCM matches the search term as a start segment, set the match type to possible match rather than completion match.
  • When one of the keywords exactly matches the search term, set the match type to possible match rather than completion match.

This makes relevant KCM results less likely to be buried far below other results, as the match type is what primarily determines how Milou ranks the result.

Additionally, when setting the relevance:

  • Choose the given relevance rather than 0.5 if the value contains any of the query words,
  • Boost the relevance by 0.1 only if the value matches the beginning of the whole query, not just the first query word.
  • Check for containing matches only when the query word is at least 3 characters long, to avoid irrelevant matches like "to" > "monitor" or "in" > "window rules" (BUG 459586).

This makes the ranking among different KCMs more appropriate, e.g. for the query "window deco", specifically the window decorations KCM would get higher relevance, and not all window related KCMs.

Also remove the generic relevance drop, since after balancing for match type, KCMs should not generally be less relevant than results from other categories.

See also: plasma-workspace!2177 (merged).

Examples:

  1. Search for "audio"

Before: Audio KCM does not even appear at all audio_before

After: Audio KCM is most relevant result audio_after

  1. Search for "color"

Before: Colors KCM appears way down color_before

After: Colors KCM is top result color_after

Edited by Natalie Clarius

Merge request reports

Loading