A forward interpretation of the form 'street, city, country' is
much more frequent than the reverse form 'country, city, street'.
Thus swap the order of interpretations that the forward order comes
first.
}
$aReverseGroupedSearches = $this->getGroupedSearches($aSearches, $aPhrases, $oValidTokens);
}
$aReverseGroupedSearches = $this->getGroupedSearches($aSearches, $aPhrases, $oValidTokens);
- foreach ($aGroupedSearches as $aSearches) {
+ foreach ($aReverseGroupedSearches as $aSearches) {
foreach ($aSearches as $aSearch) {
foreach ($aSearches as $aSearch) {
- if (!isset($aReverseGroupedSearches[$aSearch->getRank()])) {
- $aReverseGroupedSearches[$aSearch->getRank()] = array();
+ if (!isset($aGroupedSearches[$aSearch->getRank()])) {
+ $aGroupedSearches[$aSearch->getRank()] = array();
- $aReverseGroupedSearches[$aSearch->getRank()][] = $aSearch;
+ $aGroupedSearches[$aSearch->getRank()][] = $aSearch;
- $aGroupedSearches = $aReverseGroupedSearches;
ksort($aGroupedSearches);
}
} else {
ksort($aGroupedSearches);
}
} else {