]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 10 Oct 2023 09:20:26 +0000 (11:20 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 10 Oct 2023 09:20:26 +0000 (11:20 +0200)
nominatim/api/results.py
test/bdd/api/search/queries.feature

index ae1ae4ac501596c05b64c2b62e09b979bfac530a..166f501386fe3e33785064c4de08bbd3d6c86db4 100644 (file)
@@ -491,24 +491,6 @@ def _result_row_to_address_row(row: SaRow, isaddress: Optional[bool] = None) ->
                        distance=row.distance)
 
 
-def _get_housenumber_details(results: List[BaseResultT]) -> Tuple[List[int], List[int]]:
-    places = []
-    hnrs = []
-    for result in results:
-        if result.place_id:
-            housenumber = -1
-            if result.source_table in (SourceTable.TIGER, SourceTable.OSMLINE):
-                if result.housenumber is not None:
-                    housenumber = int(result.housenumber)
-                elif result.extratags is not None and 'startnumber' in result.extratags:
-                    # details requests do not come with a specific house number
-                    housenumber = int(result.extratags['startnumber'])
-            places.append(result.place_id)
-            hnrs.append(housenumber)
-
-    return places, hnrs
-
-
 def _get_address_lookup_id(result: BaseResultT) -> int:
     assert result.place_id
     if result.source_table != SourceTable.PLACEX or result.rank_search > 27:
@@ -569,7 +551,7 @@ def _setup_address_details(result: BaseResultT) -> None:
             extratags=result.extratags or {},
             admin_level=result.admin_level,
             fromarea=True, isaddress=True,
-            rank_address=result.rank_address, distance=0.0))
+            rank_address=result.rank_address or 100, distance=0.0))
     if result.source_table == SourceTable.PLACEX and result.address:
         housenumber = result.address.get('housenumber')\
                       or result.address.get('streetnumber')\
index f0474460db1deed73df3e09d6bb0ca5c12cdc01e..847f1dbf02823aff211fdfa073b65be4a042380a 100644 (file)
@@ -2,6 +2,14 @@
 Feature: Search queries
     Generic search result correctness
 
+    Scenario: Search for natural object
+        When sending json search query "Samina"
+          | accept-language |
+          | en |
+        Then results contain
+          | ID | class    | type  | display_name    |
+          | 0  | waterway | river | Samina, Austria |
+
     Scenario: House number search for non-street address
         When sending json search query "6 Silum, Liechtenstein" with address
           | accept-language |