]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/search.php
internally use higher result limits
[nominatim.git] / website / search.php
index c4d37f9bd80013321c1aaf84e959372279502bb7..c7171f98799c342eb8d8027f8183780e6e3f180b 100755 (executable)
        $sSuggestion = $sSuggestionURL = false;
        $bDeDupe = isset($_GET['dedupe'])?(bool)$_GET['dedupe']:true;
        $bReverseInPlan = false;
        $sSuggestion = $sSuggestionURL = false;
        $bDeDupe = isset($_GET['dedupe'])?(bool)$_GET['dedupe']:true;
        $bReverseInPlan = false;
-       $iLimit = isset($_GET['limit'])?(int)$_GET['limit']:10;
+       $iFinalLimit = isset($_GET['limit'])?(int)$_GET['limit']:10;
        $iOffset = isset($_GET['offset'])?(int)$_GET['offset']:0;
        $iMaxRank = 20;
        $iOffset = isset($_GET['offset'])?(int)$_GET['offset']:0;
        $iMaxRank = 20;
-       if ($iLimit > 100) $iLimit = 100;
+       if ($iFinalLimit > 50) $iFinalLimit = 50;
+    $iLimit = $iFinalLimit + min($iFinalLimit, 10);
        $iMinAddressRank = 0;
        $iMaxAddressRank = 30;
 
        $iMinAddressRank = 0;
        $iMaxAddressRank = 30;
 
                                                                else
                                                                        $sSQL .= " limit ".$iLimit;
 
                                                                else
                                                                        $sSQL .= " limit ".$iLimit;
 
-                                                               if (CONST_Debug) var_dump($sSQL);
+                                                               if (CONST_Debug) { var_dump($sSQL); }
                                                                $aViewBoxPlaceIDs = $oDB->getAll($sSQL);
                                                                if (PEAR::IsError($aViewBoxPlaceIDs))
                                                                {
                                                                $aViewBoxPlaceIDs = $oDB->getAll($sSQL);
                                                                if (PEAR::IsError($aViewBoxPlaceIDs))
                                                                {
                }
 
                // Absolute limit on number of results
                }
 
                // Absolute limit on number of results
-               if (sizeof($aSearchResults) >= $iLimit) break;
+               if (sizeof($aSearchResults) >= $iFinalLimit) break;
        }
 
        $sDataDate = $oDB->getOne("select TO_CHAR(lastimportdate - '1 day'::interval,'YYYY/MM/DD') from import_status limit 1");
        }
 
        $sDataDate = $oDB->getOne("select TO_CHAR(lastimportdate - '1 day'::interval,'YYYY/MM/DD') from import_status limit 1");