Skip to content

Commit e2d2f28

Browse files
committed
remove duplicate count
1 parent 33b9c49 commit e2d2f28

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ def get_item_collection(
8484
"bool", should=[Q("match_phrase", **{"collection": collection_id})]
8585
)
8686
search = search.query(collection_filter)
87-
try:
88-
count = search.count()
89-
except elasticsearch.exceptions.NotFoundError:
90-
raise NotFoundError("No items exist")
87+
88+
count = self.search_count(search)
89+
9190
# search = search.sort({"id.keyword" : {"order" : "asc"}})
9291
search = search.query()[0:limit]
9392
collection_children = search.execute().to_dict()

0 commit comments

Comments
 (0)