]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/search.php
more tiger import code
[nominatim.git] / website / search.php
index a123e833a0e7ee66e9dbfec0f551a8d78ae7d847..fa2dcffa11a50acf123b31f91ae8d3561447ff06 100755 (executable)
@@ -17,6 +17,7 @@
        $bDeDupe = isset($_GET['dedupe'])?(bool)$_GET['dedupe']:true;
        $bReverseInPlan = false;
        $iLimit = isset($_GET['limit'])?(int)$_GET['limit']:10;
+       $iOffset = isset($_GET['offset'])?(int)$_GET['offset']:0;
        $iMaxRank = 20;
        if ($iLimit > 100) $iLimit = 100;
 
                                                                                }
                                                                                else
                                                                                {
-                                                                                       $aSearch['aAddress'][$aSearchTerm['word_id']] = $aSearchTerm['word_id'];
-                                                                                       if (!sizeof($aSearch['aName']))
+                                                                                       if (sizeof($aSearch['aName']))
+                                                                                       {
+                                                                                               $aSearch['aAddress'][$aSearchTerm['word_id']] = $aSearchTerm['word_id'];
+                                                                                       }
+                                                                                       else
                                                                                        {
                                                                                                $aSearch['aName'][$aSearchTerm['word_id']] = $aSearchTerm['word_id'];
                                                                                                $aSearch['iNamePhrase'] = $iPhrase;
                                        {
                                                $iQueryLoop++;
                                                // Must have a location term
-                                               if (!sizeof($aSearch['aName']) && !sizeof($aSearch['aAddress']))
+                                               if (!sizeof($aSearch['aName']) && !sizeof($aSearch['aAddress'] && !$aSearch['fLon']))
                                                {
                                                        if (!$bBoundingBoxSearch && !$aSearch['fLon']) continue;
                                                        if (!$aSearch['sClass']) continue;
                                                                $oDB->query($sSQL);
                                                        
                                                                // Now they are indexed look for a house attached to a street we found
-                                                               $sSQL = "select place_id from placex where street_place_id in (".$sPlaceIDs.") and housenumber ~* E'".$sHouseNumberRegex."'";
+                                                               $sSQL = "select place_id from placex where parent_place_id in (".$sPlaceIDs.") and housenumber ~* E'".$sHouseNumberRegex."'";
                                                                if (sizeof($aExcludePlaceIDs))
                                                                {
                                                                        $sSQL .= " and place_id not in (".join(',',$aExcludePlaceIDs).")";
 
        if (CONST_Debug) exit;
 
-       include('.htlib/output/search-'.$sOutputFormat.'.php');
+       include(CONST_BasePath.'/lib/template/search-'.$sOutputFormat.'.php');