]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib-php/SearchDescription.php
add tests for sanitizer tagging language
[nominatim.git] / lib-php / SearchDescription.php
index 01d06725e5250570d80c5b1836902c184a920d43..ee8bbc0c9be81304c9531760aac3751366a6a689 100644 (file)
@@ -223,11 +223,14 @@ class SearchDescription
      * Add the given full-word token to the list of terms to search for in the
      * name.
      *
-     * @param interger iId  ID of term to add.
+     * @param interger iId    ID of term to add.
+     * @param bool bRareName  True if the term is infrequent enough to not
+     *                        require other constraints for efficient search.
      */
-    public function addNameToken($iId)
+    public function addNameToken($iId, $bRareName)
     {
         $this->aName[$iId] = $iId;
+        $this->bRareName = $bRareName;
     }
 
     /**
@@ -250,11 +253,6 @@ class SearchDescription
         $this->iNamePhrase = $iPhraseNumber;
     }
 
-    public function markRareName()
-    {
-        $this->bRareName = true;
-    }
-
     /**
      * Set country restriction for the search.
      *
@@ -626,7 +624,7 @@ class SearchDescription
             $aOrder[] = $this->oContext->distanceSQL('centroid');
         } elseif ($this->sPostcode) {
             if (empty($this->aAddress)) {
-                $aTerms[] = "EXISTS(SELECT place_id FROM location_postcode p WHERE p.postcode = '".$this->sPostcode."' AND ST_DWithin(search_name.centroid, p.geometry, 0.1))";
+                $aTerms[] = "EXISTS(SELECT place_id FROM location_postcode p WHERE p.postcode = '".$this->sPostcode."' AND ST_DWithin(search_name.centroid, p.geometry, 0.12))";
             } else {
                 $aOrder[] = "(SELECT min(ST_Distance(search_name.centroid, p.geometry)) FROM location_postcode p WHERE p.postcode = '".$this->sPostcode."')";
             }