mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-07 02:24:08 +00:00
for structured queries assume 2 char country param values are a iso country code
This commit is contained in:
@@ -416,6 +416,13 @@
|
|||||||
$aWordFrequencyScores = array();
|
$aWordFrequencyScores = array();
|
||||||
foreach($aDatabaseWords as $aToken)
|
foreach($aDatabaseWords as $aToken)
|
||||||
{
|
{
|
||||||
|
// Very special case - require 2 letter country param to match the country code found
|
||||||
|
if ($bStructuredPhrases && $aToken['country_code'] && !empty($aStructuredQuery['country'])
|
||||||
|
&& strlen($aStructuredQuery['country']) == 2 && strtolower($aStructuredQuery['country']) != $aToken['country_code'])
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($aValidTokens[$aToken['word_token']]))
|
if (isset($aValidTokens[$aToken['word_token']]))
|
||||||
{
|
{
|
||||||
$aValidTokens[$aToken['word_token']][] = $aToken;
|
$aValidTokens[$aToken['word_token']][] = $aToken;
|
||||||
|
|||||||
Reference in New Issue
Block a user