summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e7e7ae0)
Housenumber searches without a name cannot exist per
definition. Searches with only a name but no address
should not fall back on a search without house number.
This should improve postcode only search.
//if (CONST_Debug) _debugDumpGroupedSearches($aGroupedSearches, $aValidTokens);
}
//if (CONST_Debug) _debugDumpGroupedSearches($aGroupedSearches, $aValidTokens);
}
+
+ // Revisit searches, giving penalty to unlikely combinations
+ $aGroupedSearches = array();
+ foreach ($aSearches as $aSearch) {
+ if (!$aSearch['aName']) {
+ if ($aSearch['sHouseNumber']) {
+ continue;
+ }
+ }
+ $aGroupedSearches[$aSearch['iSearchRank']][] = $aSearch;
+ }
+ ksort($aGroupedSearches);
+
return $aGroupedSearches;
}
return $aGroupedSearches;
}
}
// Fallback to the road (if no housenumber was found)
}
// Fallback to the road (if no housenumber was found)
- if (!sizeof($aPlaceIDs) && preg_match('/[0-9]+/', $aSearch['sHouseNumber'])) {
+ if (!sizeof($aPlaceIDs) && preg_match('/[0-9]+/', $aSearch['sHouseNumber'])
+ && ($aSearch['aAddress'] || $aSearch['sCountryCode'])) {
$aPlaceIDs = $aRoadPlaceIDs;
//set to -1, if no housenumbers were found
$searchedHousenumber = -1;
$aPlaceIDs = $aRoadPlaceIDs;
//set to -1, if no housenumbers were found
$searchedHousenumber = -1;