add server fronting for search endpoint

This also implements some of the quirks of free-text search of the
V1 API, in particular, search for categories and coordinates.
This commit is contained in:
Sarah Hoffmann
2023-05-26 11:40:45 +02:00
parent c7db69a30c
commit 371a780ef4
6 changed files with 535 additions and 14 deletions

View File

@@ -228,6 +228,12 @@ class SearchResults(List[SearchResult]):
May be empty when no result was found.
"""
def localize(self, locales: Locales) -> None:
""" Apply the given locales to all results.
"""
for result in self:
result.localize(locales)
def _filter_geometries(row: SaRow) -> Dict[str, str]:
return {k[9:]: v for k, v in row._mapping.items() # pylint: disable=W0212