]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/results.py
Merge pull request #3006 from biswajit-k/generalize-filter
[nominatim.git] / nominatim / api / results.py
index 098851ef1b8a39da145eba2b7ba5968f45e84f34..98b13380726e98361bc2571c85bd78928c1afc12 100644 (file)
@@ -173,6 +173,19 @@ class ReverseResults(List[ReverseResult]):
     """
 
 
+@dataclasses.dataclass
+class SearchResult(BaseResult):
+    """ A search result for forward geocoding.
+    """
+    bbox: Optional[Bbox] = None
+
+
+class SearchResults(List[SearchResult]):
+    """ Sequence of forward lookup results ordered by relevance.
+        May be empty when no result was found.
+    """
+
+
 def _filter_geometries(row: SaRow) -> Dict[str, str]:
     return {k[9:]: v for k, v in row._mapping.items() # pylint: disable=W0212
             if k.startswith('geometry_')}