Skip to content

Commit 240552f

Browse files
Merge branch 'main' into CAT-1413
2 parents 6c0c60a + 8974c38 commit 240552f

File tree

24 files changed

+224
-144
lines changed

24 files changed

+224
-144
lines changed

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,25 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
88

99
## [Unreleased]
1010

11+
### Added
12+
13+
### Changed
14+
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+
17+
### Fixed
18+
19+
## [v6.2.1] - 2025-09-02
20+
21+
### Added
22+
23+
- Added `id` field as secondary sort to sort config to ensure unique pagination tokens. [#421](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/421)
1124
- Added default environment variable `STAC_ITEM_LIMIT` to SFEOS for result limiting of returned items and STAC collections [#419](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/419)
1225

26+
### Changed
27+
28+
- Simplified Patch class and updated patch script creation including adding nest creation for merge patch [#420](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/420)
29+
1330
## [v6.2.0] - 2025-08-27
1431

1532
### Added
@@ -475,7 +492,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
475492
- Use genexp in execute_search and get_all_collections to return results.
476493
- Added db_to_stac serializer to item_collection method in core.py.
477494

478-
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.2.0...main
495+
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.2.1...main
496+
[v6.2.1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.2.0...v6.2.1
479497
[v6.2.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.1.0...v6.2.0
480498
[v6.1.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.0.0...v6.1.0
481499
[v6.0.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v5.0.0...v6.0.0

compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=6.2.0
12+
- STAC_FASTAPI_VERSION=6.2.1
1313
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1414
- APP_HOST=0.0.0.0
1515
- APP_PORT=8080
@@ -43,7 +43,7 @@ services:
4343
environment:
4444
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4545
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
46-
- STAC_FASTAPI_VERSION=6.2.0
46+
- STAC_FASTAPI_VERSION=6.2.1
4747
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-opensearch
4848
- APP_HOST=0.0.0.0
4949
- APP_PORT=8082

examples/auth/compose.basic_auth.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=6.2.0
12+
- STAC_FASTAPI_VERSION=6.2.1
1313
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1414
- APP_HOST=0.0.0.0
1515
- APP_PORT=8080
@@ -43,7 +43,7 @@ services:
4343
environment:
4444
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4545
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
46-
- STAC_FASTAPI_VERSION=6.2.0
46+
- STAC_FASTAPI_VERSION=6.2.1
4747
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-opensearch
4848
- APP_HOST=0.0.0.0
4949
- APP_PORT=8082

examples/auth/compose.oauth2.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=6.2.0
12+
- STAC_FASTAPI_VERSION=6.2.1
1313
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1414
- APP_HOST=0.0.0.0
1515
- APP_PORT=8080
@@ -44,7 +44,7 @@ services:
4444
environment:
4545
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4646
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
47-
- STAC_FASTAPI_VERSION=6.2.0
47+
- STAC_FASTAPI_VERSION=6.2.1
4848
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-opensearch
4949
- APP_HOST=0.0.0.0
5050
- APP_PORT=8082

examples/auth/compose.route_dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=6.2.0
12+
- STAC_FASTAPI_VERSION=6.2.1
1313
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1414
- APP_HOST=0.0.0.0
1515
- APP_PORT=8080
@@ -43,7 +43,7 @@ services:
4343
environment:
4444
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4545
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
46-
- STAC_FASTAPI_VERSION=6.2.0
46+
- STAC_FASTAPI_VERSION=6.2.1
4747
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-opensearch
4848
- APP_HOST=0.0.0.0
4949
- APP_PORT=8082

examples/rate_limit/compose.rate_limit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=6.2.0
12+
- STAC_FASTAPI_VERSION=6.2.1
1313
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1414
- APP_HOST=0.0.0.0
1515
- APP_PORT=8080
@@ -43,7 +43,7 @@ services:
4343
environment:
4444
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4545
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
46-
- STAC_FASTAPI_VERSION=6.2.0
46+
- STAC_FASTAPI_VERSION=6.2.1
4747
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-opensearch
4848
- APP_HOST=0.0.0.0
4949
- APP_PORT=8082

stac_fastapi/core/stac_fastapi/core/base_database_logic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ async def json_patch_item(
4848
item_id: str,
4949
operations: List,
5050
base_url: str,
51+
create_nest: bool = False,
5152
refresh: bool = True,
5253
) -> Dict:
5354
"""Patch a item in the database follows RF6902."""
@@ -94,6 +95,7 @@ async def json_patch_collection(
9495
collection_id: str,
9596
operations: List,
9697
base_url: str,
98+
create_nest: bool = False,
9799
refresh: bool = True,
98100
) -> Dict:
99101
"""Patch a collection in the database follows RF6902."""

stac_fastapi/core/stac_fastapi/core/serializers.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ 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+
6973
now = now_to_rfc3339_str()
7074
if "created" not in stac_data["properties"]:
7175
stac_data["properties"]["created"] = now
@@ -103,7 +107,7 @@ def db_to_stac(cls, item: dict, base_url: str) -> stac_types.Item:
103107
bbox=item.get("bbox", []),
104108
properties=item.get("properties", {}),
105109
links=item_links,
106-
assets=item.get("assets", {}),
110+
assets={a.pop("es_key"): a for a in item.get("assets", [])},
107111
)
108112

109113

@@ -128,6 +132,9 @@ def stac_to_db(
128132
collection["links"] = resolve_links(
129133
collection.get("links", []), str(request.base_url)
130134
)
135+
collection["assets"] = [
136+
{"es_key": k, **v} for k, v in collection.get("assets", {}).items()
137+
]
131138
return collection
132139

133140
@classmethod
@@ -174,5 +181,9 @@ def db_to_stac(
174181
collection_links += resolve_links(original_links, str(request.base_url))
175182
collection["links"] = collection_links
176183

184+
collection["assets"] = {
185+
a.pop("es_key"): a for a in collection.get("assets", [])
186+
}
187+
177188
# Return the stac_types.Collection object
178189
return stac_types.Collection(**collection)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "6.2.0"
2+
__version__ = "6.2.1"

stac_fastapi/elasticsearch/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
desc = f.read()
77

88
install_requires = [
9-
"stac-fastapi-core==6.2.0",
10-
"sfeos-helpers==6.2.0",
9+
"stac-fastapi-core==6.2.1",
10+
"sfeos-helpers==6.2.1",
1111
"elasticsearch[async]~=8.18.0",
1212
"uvicorn~=0.23.0",
1313
"starlette>=0.35.0,<0.36.0",

0 commit comments

Comments
 (0)