diff --git a/api/app/elastic.py b/api/app/elastic.py index 643781d..f49f4e5 100644 --- a/api/app/elastic.py +++ b/api/app/elastic.py @@ -28,35 +28,22 @@ def search_documents(self, longitude: float, latitude: float, radius: str) -> li "size": 1000, "query": { "bool": { - "must": { - "match_all": {} - }, - "filter": { - "geo_distance": { - "distance": radius, - "coordinates": { - "lat": latitude, - "lon": longitude - } - } - } + "must": {"match_all": {}}, + "filter": {"geo_distance": {"distance": radius, "coordinates": {"lat": latitude, "lon": longitude}}}, } }, "sort": [ { "_geo_distance": { - "coordinates": { - "lat": latitude, - "lon": longitude - }, + "coordinates": {"lat": latitude, "lon": longitude}, "order": "asc", "unit": "km", "mode": "min", "distance_type": "arc", - "ignore_unmapped": True + "ignore_unmapped": True, } } - ] + ], } ) hits = response["hits"]["hits"]