diff --git a/inc/Ui/Search.php b/inc/Ui/Search.php
index 1ac9fcd40c410c104a0c871bd69dab314bfda481..6f6d324c01693241fcbefcdca794d9ec4257fcdb 100644
--- a/inc/Ui/Search.php
+++ b/inc/Ui/Search.php
@@ -373,6 +373,7 @@ class Search extends Ui
             }
             $namespaces[$subtopNS] += 1;
         }
+        ksort($namespaces);
         arsort($namespaces);
         return $namespaces;
     }