Skip to content

Commit 5f7c567

Browse files
committed
move serializer to post search
1 parent 9f8dc40 commit 5f7c567

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ async def post_search(
272272
base_url=base_url,
273273
)
274274

275+
items = [
276+
self.item_serializer.db_to_stac(item, base_url=base_url)
277+
for item in items
278+
]
279+
275280
# if self.extension_is_enabled("FieldsExtension"):
276281
# if search_request.query is not None:
277282
# query_include: Set[str] = set(

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ async def execute_search(
221221

222222
hits = es_response["hits"]["hits"]
223223
items = [
224-
self.item_serializer.db_to_stac(hit["_source"], base_url=base_url)
225-
for hit in hits
224+
hit["_source"] for hit in hits
226225
]
227226

228227
next_token = None

0 commit comments

Comments
 (0)