Skip to content

Commit e24498f

Browse files
committed
Revert "Enabling asset indexing (stac-utils#341)"
This reverts commit 8974c38.
1 parent 8974c38 commit e24498f

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1212

1313
### Changed
1414

15-
- Changed assets serialization to prevent mapping explosion while allowing asset inforamtion to be indexed. [#341](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/341)
16-
1715
### Fixed
1816

1917
## [v6.2.1] - 2025-09-02

stac_fastapi/core/stac_fastapi/core/serializers.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ def stac_to_db(cls, stac_data: stac_types.Item, base_url: str) -> stac_types.Ite
6666
item_links = resolve_links(stac_data.get("links", []), base_url)
6767
stac_data["links"] = item_links
6868

69-
stac_data["assets"] = [
70-
{"es_key": k, **v} for k, v in stac_data.get("assets", {}).items()
71-
]
72-
7369
now = now_to_rfc3339_str()
7470
if "created" not in stac_data["properties"]:
7571
stac_data["properties"]["created"] = now
@@ -107,7 +103,7 @@ def db_to_stac(cls, item: dict, base_url: str) -> stac_types.Item:
107103
bbox=item.get("bbox", []),
108104
properties=item.get("properties", {}),
109105
links=item_links,
110-
assets={a.pop("es_key"): a for a in item.get("assets", [])},
106+
assets=item.get("assets", {}),
111107
)
112108

113109

@@ -132,9 +128,6 @@ def stac_to_db(
132128
collection["links"] = resolve_links(
133129
collection.get("links", []), str(request.base_url)
134130
)
135-
collection["assets"] = [
136-
{"es_key": k, **v} for k, v in collection.get("assets", {}).items()
137-
]
138131
return collection
139132

140133
@classmethod
@@ -181,9 +174,5 @@ def db_to_stac(
181174
collection_links += resolve_links(original_links, str(request.base_url))
182175
collection["links"] = collection_links
183176

184-
collection["assets"] = {
185-
a.pop("es_key"): a for a in collection.get("assets", [])
186-
}
187-
188177
# Return the stac_types.Collection object
189178
return stac_types.Collection(**collection)

stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/mappings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class Geometry(Protocol): # noqa
134134
"id": {"type": "keyword"},
135135
"collection": {"type": "keyword"},
136136
"geometry": {"type": "geo_shape"},
137-
"assets": {"type": "object"},
137+
"assets": {"type": "object", "enabled": False},
138138
"links": {"type": "object", "enabled": False},
139139
"properties": {
140140
"type": "object",

0 commit comments

Comments
 (0)