We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1262e89 commit 7542398Copy full SHA for 7542398
stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/core.py
@@ -320,7 +320,11 @@ def post_search(
320
field = sort.field + ".keyword"
321
search = search.sort({field: {"order": sort.direction}})
322
323
- count = search.count()
+ try:
324
+ count = search.count()
325
+ except elasticsearch.exceptions.NotFoundError:
326
+ raise NotFoundError("No items have been added to the database yet")
327
+
328
# search = search.sort({"id.keyword" : {"order" : "asc"}})
329
search = search.query()[0 : search_request.limit]
330
response = search.execute().to_dict()
0 commit comments