]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib-php/Result.php
ICU: additional ranking by matching of normalised term
[nominatim.git] / lib-php / Result.php
index be103074040da27e56dfc9a914baa868cc3da8e3..774b7ca60b4c0a9ea51c913638d39c42c3cd5fc5 100644 (file)
@@ -55,6 +55,27 @@ class Result
             }
         )));
     }
             }
         )));
     }
+
+    public static function joinIdsByTableMinRank($aResults, $iTable, $iMinAddressRank)
+    {
+        return join(',', array_keys(array_filter(
+            $aResults,
+            function ($aValue) use ($iTable, $iMinAddressRank) {
+                return $aValue->iTable == $iTable && $aValue->iAddressRank >= $iMinAddressRank;
+            }
+        )));
+    }
+
+    public static function joinIdsByTableMaxRank($aResults, $iTable, $iMaxAddressRank)
+    {
+        return join(',', array_keys(array_filter(
+            $aResults,
+            function ($aValue) use ($iTable, $iMaxAddressRank) {
+                return $aValue->iTable == $iTable && $aValue->iAddressRank <= $iMaxAddressRank;
+            }
+        )));
+    }
+
     public static function sqlHouseNumberTable($aResults, $iTable)
     {
         $sHousenumbers = '';
     public static function sqlHouseNumberTable($aResults, $iTable)
     {
         $sHousenumbers = '';