+
+ // Revisit searches, giving penalty to unlikely combinations
+ $aGroupedSearches = array();
+ foreach ($aSearches as $aSearch) {
+ if (!$aSearch['aName']) {
+ if ($aSearch['sHouseNumber']) {
+ continue;
+ }
+ }
+ $aSearch['iSearchRank'] += $iGlobalRank;
+ $aGroupedSearches[$aSearch['iSearchRank']][] = $aSearch;
+ }
+ ksort($aGroupedSearches);
+