Diffusion Milou aa9e1d6c3f15

Prefer categories with the query string visible in results

Authored by broulik on Aug 6 2019, 1:28 PM.

Description

Prefer categories with the query string visible in results

This logic was present in the old model and keeps e.g. Baloo file search results from getting higher priority than likely more useful
application results with the given name. It only affects the order of categories, e.g. scoring "Applications" higher than "Documents"
if such a match exists.

The order of matches within a category is untouched and remains determined by the runner based on type and relevance.
Since the "relevance" of a QueryMatch is global and determined freely by the runners which don't know what other results
might already be present, we have to resort to some fuzzy logic like this.

Differential Revision: https://phabricator.kde.org/D22888