mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 13:24:07 +00:00
apply rank restrictions already when scanning search_name table
fixes #176
This commit is contained in:
@@ -1262,7 +1262,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($aSearch['sCountryCode']) $aTerms[] = "country_code = '".pg_escape_string($aSearch['sCountryCode'])."'";
|
if ($aSearch['sCountryCode']) $aTerms[] = "country_code = '".pg_escape_string($aSearch['sCountryCode'])."'";
|
||||||
if ($aSearch['sHouseNumber']) $aTerms[] = "address_rank between 16 and 27";
|
if ($aSearch['sHouseNumber'])
|
||||||
|
{
|
||||||
|
$aTerms[] = "address_rank between 16 and 27";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($this->iMinAddressRank > 0)
|
||||||
|
{
|
||||||
|
$aTerms[] = "address_rank >= ".$this->iMinAddressRank;
|
||||||
|
}
|
||||||
|
if ($this->iMaxAddressRank < 30)
|
||||||
|
{
|
||||||
|
$aTerms[] = "address_rank <= ".$this->iMaxAddressRank;
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($aSearch['fLon'] && $aSearch['fLat'])
|
if ($aSearch['fLon'] && $aSearch['fLat'])
|
||||||
{
|
{
|
||||||
$aTerms[] = "ST_DWithin(centroid, ST_SetSRID(ST_Point(".$aSearch['fLon'].",".$aSearch['fLat']."),4326), ".$aSearch['fRadius'].")";
|
$aTerms[] = "ST_DWithin(centroid, ST_SetSRID(ST_Point(".$aSearch['fLon'].",".$aSearch['fLat']."),4326), ".$aSearch['fRadius'].")";
|
||||||
|
|||||||
Reference in New Issue
Block a user