replace word frequency hash

The word frequency hash was only used to determine if the
name of a SearchDescription is rare. Do this already when
building the SearchDescription (when the word frequency
is still available) and get gid of the extra hash.
This commit is contained in:
Sarah Hoffmann
2018-05-06 22:10:38 +02:00
parent 7075a5828e
commit 115792d1db
2 changed files with 21 additions and 19 deletions

View File

@@ -658,7 +658,6 @@ class Geocode
$this->oDB->getAll($sSQL),
'Could not get word tokens.'
);
$aWordFrequencyScores = array();
foreach ($aDatabaseWords as $aToken) {
// Filter country tokens that do not match restricted countries.
if ($this->aCountryCodes
@@ -681,7 +680,6 @@ class Geocode
} else {
$aValidTokens[$aToken['word_token']] = array($aToken);
}
$aWordFrequencyScores[$aToken['word_id']] = $aToken['search_name_count'] + 1;
}
// US ZIP+4 codes - if there is no token, merge in the 5-digit ZIP code
@@ -781,7 +779,6 @@ class Geocode
$aResults += $oSearch->query(
$this->oDB,
$aWordFrequencyScores,
$this->iMinAddressRank,
$this->iMaxAddressRank,
$this->iLimit