Commit 1c8b5ea3 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Tabs Runner] Slightly better scoring

Score results that contain the term in its unbroken consecutive form
slightly higher than ones that are a mere subsequence.
parent 474f51b9
......@@ -145,9 +145,12 @@ void TabsRunnerPlugin::handleData(const QString& event, const QJsonObject& json)
match.type = Plasma::QueryMatch::PossibleMatch;
if (KApplicationTrader::isSubsequence(query, text, Qt::CaseInsensitive)) {
relevance = 0.9;
if (text.startsWith(query, Qt::CaseInsensitive)) {
relevance += 0.1;
relevance = 0.85;
if (text.contains(query, Qt::CaseInsensitive)) {
relevance += 0.05;
if (text.startsWith(query, Qt::CaseInsensitive)) {
relevance += 0.05;
}
}
} else if (url.host().contains(query, Qt::CaseInsensitive)) {
relevance = 0.7;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment