X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/f335e78d1eb54737202aa7a1bafaece19b6659a6..1b50381852850807a688270312952d74a309f09c:/nominatim/api/v1/format.py diff --git a/nominatim/api/v1/format.py b/nominatim/api/v1/format.py index 7492e48d..ad635e39 100644 --- a/nominatim/api/v1/format.py +++ b/nominatim/api/v1/format.py @@ -168,7 +168,7 @@ def _format_details_json(result: napi.DetailedResult, options: Mapping[str, Any] def _format_reverse_xml(results: napi.ReverseResults, options: Mapping[str, Any]) -> str: return format_xml.format_base_xml(results, options, True, 'reversegeocode', - {'querystring': 'TODO'}) + {'querystring': options.get('query', '')}) @dispatch.format_func(napi.ReverseResults, 'geojson') @@ -199,9 +199,13 @@ def _format_reverse_jsonv2(results: napi.ReverseResults, @dispatch.format_func(napi.SearchResults, 'xml') def _format_search_xml(results: napi.SearchResults, options: Mapping[str, Any]) -> str: - return format_xml.format_base_xml(results, - options, False, 'searchresults', - {'querystring': 'TODO'}) + extra = {'querystring': options.get('query', '')} + for attr in ('more_url', 'exclude_place_ids', 'viewbox'): + if options.get(attr): + extra[attr] = options[attr] + return format_xml.format_base_xml(results, options, False, 'searchresults', + extra) + @dispatch.format_func(napi.SearchResults, 'geojson')