Skip to content

Commit

Permalink
registry: Remove pointless ORDER BY clauses for search queries
Browse files Browse the repository at this point in the history
We sort all results again anyway.
  • Loading branch information
trollixx committed Apr 26, 2017
1 parent 7b1223b commit c6003e1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/libs/registry/docset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,25 +263,21 @@ QList<SearchResult> Docset::search(const QString &query, const CancellationToken
if (m_fuzzySearchEnabled) {
sql = QStringLiteral("SELECT name, type, path, '', zealScore('%1', name) as score"
" FROM searchIndex"
" WHERE score > 0"
" ORDER BY score DESC");
" WHERE score > 0");
} else {
sql = QStringLiteral("SELECT name, type, path, ''"
" FROM searchIndex"
" WHERE (name LIKE '%%1%' ESCAPE '\\')"
" ORDER BY name COLLATE NOCASE");
" WHERE (name LIKE '%%1%' ESCAPE '\\')");
}
} else {
if (m_fuzzySearchEnabled) {
sql = QStringLiteral("SELECT name, type, path, fragment, zealScore('%1', name) as score"
" FROM searchIndex"
" WHERE score > 0"
" ORDER BY score DESC");
" WHERE score > 0");
} else {
sql = QStringLiteral("SELECT name, type, path, fragment"
" FROM searchIndex"
" WHERE (name LIKE '%%1%' ESCAPE '\\')"
" ORDER BY name COLLATE NOCASE");
" WHERE (name LIKE '%%1%' ESCAPE '\\')");
}
}

Expand Down

0 comments on commit c6003e1

Please sign in to comment.