forked from hans/Nominatim
Merge pull request #1005 from lonvia/no-limit-for-housenumber-search
do not apply limit to house number place searches
This commit is contained in:
@@ -436,7 +436,7 @@ class SearchDescription
|
|||||||
//now search for housenumber, if housenumber provided
|
//now search for housenumber, if housenumber provided
|
||||||
if ($this->sHouseNumber && !empty($aResults)) {
|
if ($this->sHouseNumber && !empty($aResults)) {
|
||||||
$aNamedPlaceIDs = $aResults;
|
$aNamedPlaceIDs = $aResults;
|
||||||
$aResults = $this->queryHouseNumber($oDB, $aNamedPlaceIDs, $iLimit);
|
$aResults = $this->queryHouseNumber($oDB, $aNamedPlaceIDs);
|
||||||
|
|
||||||
if (empty($aResults) && $this->looksLikeFullAddress()) {
|
if (empty($aResults) && $this->looksLikeFullAddress()) {
|
||||||
$aResults = $aNamedPlaceIDs;
|
$aResults = $aNamedPlaceIDs;
|
||||||
@@ -717,7 +717,7 @@ class SearchDescription
|
|||||||
return $aResults;
|
return $aResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function queryHouseNumber(&$oDB, $aRoadPlaceIDs, $iLimit)
|
private function queryHouseNumber(&$oDB, $aRoadPlaceIDs)
|
||||||
{
|
{
|
||||||
$aResults = array();
|
$aResults = array();
|
||||||
$sPlaceIDs = Result::joinIdsByTable($aRoadPlaceIDs, Result::TABLE_PLACEX);
|
$sPlaceIDs = Result::joinIdsByTable($aRoadPlaceIDs, Result::TABLE_PLACEX);
|
||||||
@@ -731,7 +731,6 @@ class SearchDescription
|
|||||||
$sSQL .= 'WHERE parent_place_id in ('.$sPlaceIDs.')';
|
$sSQL .= 'WHERE parent_place_id in ('.$sPlaceIDs.')';
|
||||||
$sSQL .= " AND transliteration(housenumber) ~* E'".$sHouseNumberRegex."'";
|
$sSQL .= " AND transliteration(housenumber) ~* E'".$sHouseNumberRegex."'";
|
||||||
$sSQL .= $this->oContext->excludeSQL(' AND place_id');
|
$sSQL .= $this->oContext->excludeSQL(' AND place_id');
|
||||||
$sSQL .= " LIMIT $iLimit";
|
|
||||||
|
|
||||||
Debug::printSQL($sSQL);
|
Debug::printSQL($sSQL);
|
||||||
|
|
||||||
@@ -759,7 +758,6 @@ class SearchDescription
|
|||||||
$sSQL .= $iHousenumber.'>=startnumber and ';
|
$sSQL .= $iHousenumber.'>=startnumber and ';
|
||||||
$sSQL .= $iHousenumber.'<=endnumber';
|
$sSQL .= $iHousenumber.'<=endnumber';
|
||||||
$sSQL .= $this->oContext->excludeSQL(' AND place_id');
|
$sSQL .= $this->oContext->excludeSQL(' AND place_id');
|
||||||
$sSQL .= " limit $iLimit";
|
|
||||||
|
|
||||||
Debug::printSQL($sSQL);
|
Debug::printSQL($sSQL);
|
||||||
|
|
||||||
@@ -776,7 +774,6 @@ class SearchDescription
|
|||||||
$sSQL .= ' WHERE parent_place_id in ('.$sPlaceIDs.')';
|
$sSQL .= ' WHERE parent_place_id in ('.$sPlaceIDs.')';
|
||||||
$sSQL .= " AND housenumber = '".$this->sHouseNumber."'";
|
$sSQL .= " AND housenumber = '".$this->sHouseNumber."'";
|
||||||
$sSQL .= $this->oContext->excludeSQL(' AND place_id');
|
$sSQL .= $this->oContext->excludeSQL(' AND place_id');
|
||||||
$sSQL .= " limit $iLimit";
|
|
||||||
|
|
||||||
Debug::printSQL($sSQL);
|
Debug::printSQL($sSQL);
|
||||||
|
|
||||||
@@ -798,7 +795,6 @@ class SearchDescription
|
|||||||
$sSQL .= $iHousenumber.'>=startnumber and ';
|
$sSQL .= $iHousenumber.'>=startnumber and ';
|
||||||
$sSQL .= $iHousenumber.'<=endnumber';
|
$sSQL .= $iHousenumber.'<=endnumber';
|
||||||
$sSQL .= $this->oContext->excludeSQL(' AND place_id');
|
$sSQL .= $this->oContext->excludeSQL(' AND place_id');
|
||||||
$sSQL .= " limit $iLimit";
|
|
||||||
|
|
||||||
Debug::printSQL($sSQL);
|
Debug::printSQL($sSQL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user