From 5a4dc5b77d33113dd9eac5432eb4d43736c91073 Mon Sep 17 00:00:00 2001 From: Marcin Niemyjski Date: Thu, 4 Sep 2025 12:50:05 +0200 Subject: [PATCH 1/9] added missing copy(), updated DEFAULT_QUERYABLES so it contains only generic attributes --- .../stac_fastapi/core/extensions/filter.py | 18 ------------------ .../sfeos_helpers/filter/client.py | 12 +++++------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/stac_fastapi/core/stac_fastapi/core/extensions/filter.py b/stac_fastapi/core/stac_fastapi/core/extensions/filter.py index c68596726..ddeb2600d 100644 --- a/stac_fastapi/core/stac_fastapi/core/extensions/filter.py +++ b/stac_fastapi/core/stac_fastapi/core/extensions/filter.py @@ -41,24 +41,6 @@ "description": "Creation Timestamp", "$ref": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/datetime.json#/properties/updated", }, - "cloud_cover": { - "description": "Cloud Cover", - "$ref": "https://stac-extensions.github.io/eo/v1.0.0/schema.json#/definitions/fields/properties/eo:cloud_cover", - }, - "cloud_shadow_percentage": { - "title": "Cloud Shadow Percentage", - "description": "Cloud Shadow Percentage", - "type": "number", - "minimum": 0, - "maximum": 100, - }, - "nodata_pixel_percentage": { - "title": "No Data Pixel Percentage", - "description": "No Data Pixel Percentage", - "type": "number", - "minimum": 0, - "maximum": 100, - }, } """Queryables that are present in all collections.""" diff --git a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py index 9d0eb69b8..50283b456 100644 --- a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py +++ b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py @@ -49,13 +49,11 @@ async def get_queryables( if not collection_id: return queryables - properties: Dict[str, Any] = queryables["properties"] - queryables.update( - { - "properties": properties, - "additionalProperties": False, - } - ) + properties: Dict[str, Any] = queryables["properties"].copy() + queryables.update({ + "properties": properties, + "additionalProperties": False, + }) mapping_data = await self.database.get_items_mapping(collection_id) mapping_properties = next(iter(mapping_data.values()))["mappings"]["properties"] From defafc50bb23d3ad320f856b7cfe5ab078d7f4f8 Mon Sep 17 00:00:00 2001 From: Marcin Niemyjski Date: Thu, 4 Sep 2025 13:01:02 +0200 Subject: [PATCH 2/9] precommit fixes --- .../stac_fastapi/sfeos_helpers/filter/client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py index 50283b456..512b1b025 100644 --- a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py +++ b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py @@ -50,10 +50,12 @@ async def get_queryables( return queryables properties: Dict[str, Any] = queryables["properties"].copy() - queryables.update({ - "properties": properties, - "additionalProperties": False, - }) + queryables.update( + { + "properties": properties, + "additionalProperties": False, + } + ) mapping_data = await self.database.get_items_mapping(collection_id) mapping_properties = next(iter(mapping_data.values()))["mappings"]["properties"] From c14529c43c2b5746fdbffb1ab8ae0d2c535e8486 Mon Sep 17 00:00:00 2001 From: Marcin Niemyjski Date: Thu, 4 Sep 2025 14:05:29 +0200 Subject: [PATCH 3/9] queryables, updated: "$schema" to the one from pgstac (seems newer and more advanced) "$id" made it dynamic --- .../stac_fastapi/sfeos_helpers/filter/client.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py index 512b1b025..e3df6ecb1 100644 --- a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py +++ b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py @@ -4,6 +4,7 @@ from typing import Any, Dict, Optional, Tuple import attr +from fastapi import Request from stac_fastapi.core.base_database_logic import BaseDatabaseLogic from stac_fastapi.core.extensions.filter import ALL_QUERYABLES, DEFAULT_QUERYABLES @@ -20,6 +21,7 @@ class EsAsyncBaseFiltersClient(AsyncBaseFiltersClient): async def get_queryables( self, collection_id: Optional[str] = None, **kwargs ) -> Dict[str, Any]: + request: Optional[Request] = kwargs.get("request").url """Get the queryables available for the given collection_id. If collection_id is None, returns the intersection of all @@ -38,8 +40,8 @@ async def get_queryables( Dict[str, Any]: A dictionary containing the queryables for the given collection. """ queryables: Dict[str, Any] = { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://stac-api.example.com/queryables", + "$schema": "https://json-schema.org/draft-07/schema#", + "$id": f"{request!s}", "type": "object", "title": "Queryables for STAC API", "description": "Queryable names for the STAC API Item Search filter.", @@ -50,12 +52,10 @@ async def get_queryables( return queryables properties: Dict[str, Any] = queryables["properties"].copy() - queryables.update( - { - "properties": properties, - "additionalProperties": False, - } - ) + queryables.update({ + "properties": properties, + "additionalProperties": False, + }) mapping_data = await self.database.get_items_mapping(collection_id) mapping_properties = next(iter(mapping_data.values()))["mappings"]["properties"] From 45b4b96f00b902d34e802cd65aff81710e65c036 Mon Sep 17 00:00:00 2001 From: Marcin Niemyjski Date: Fri, 5 Sep 2025 10:43:26 +0200 Subject: [PATCH 4/9] provided mandatory fixes mentioned by Zaczero --- .../stac_fastapi/sfeos_helpers/filter/client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py index e3df6ecb1..98893277f 100644 --- a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py +++ b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py @@ -21,7 +21,6 @@ class EsAsyncBaseFiltersClient(AsyncBaseFiltersClient): async def get_queryables( self, collection_id: Optional[str] = None, **kwargs ) -> Dict[str, Any]: - request: Optional[Request] = kwargs.get("request").url """Get the queryables available for the given collection_id. If collection_id is None, returns the intersection of all @@ -39,9 +38,11 @@ async def get_queryables( Returns: Dict[str, Any]: A dictionary containing the queryables for the given collection. """ + request: Optional[Request] = kwargs.get("request") + url_str: Optional[str] = str(request.url) if request else "" queryables: Dict[str, Any] = { - "$schema": "https://json-schema.org/draft-07/schema#", - "$id": f"{request!s}", + "$schema": "https://json-schema.org/draft-07/schema", + "$id": f"{url_str}", "type": "object", "title": "Queryables for STAC API", "description": "Queryable names for the STAC API Item Search filter.", From 9b2c7f24e10b8bd89abe54cfc30e50d2414c062c Mon Sep 17 00:00:00 2001 From: Marcin Niemyjski Date: Fri, 5 Sep 2025 10:46:57 +0200 Subject: [PATCH 5/9] removed Optional from url_str --- .../sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py index 98893277f..8a9cf4284 100644 --- a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py +++ b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py @@ -39,7 +39,7 @@ async def get_queryables( Dict[str, Any]: A dictionary containing the queryables for the given collection. """ request: Optional[Request] = kwargs.get("request") - url_str: Optional[str] = str(request.url) if request else "" + url_str: str = str(request.url) if request else "" queryables: Dict[str, Any] = { "$schema": "https://json-schema.org/draft-07/schema", "$id": f"{url_str}", From f4a98e365d1cb58f620e8193ead2be979b70150b Mon Sep 17 00:00:00 2001 From: Marcin Niemyjski Date: Fri, 12 Sep 2025 13:10:04 +0200 Subject: [PATCH 6/9] fix error causing illegal_argument_exception --- .../stac_fastapi/opensearch/database_logic.py | 57 ++++++++++--------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py b/stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py index 0e6b7b6dc..45e609496 100644 --- a/stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py +++ b/stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py @@ -3,8 +3,9 @@ import asyncio import logging from base64 import urlsafe_b64decode, urlsafe_b64encode +from collections.abc import Iterable from copy import deepcopy -from typing import Any, Dict, Iterable, List, Optional, Tuple, Type +from typing import Any, Dict, List, Optional, Tuple, Type import attr import orjson @@ -12,8 +13,6 @@ from opensearchpy import exceptions, helpers from opensearchpy.helpers.query import Q from opensearchpy.helpers.search import Search -from starlette.requests import Request - from stac_fastapi.core.base_database_logic import BaseDatabaseLogic from stac_fastapi.core.serializers import CollectionSerializer, ItemSerializer from stac_fastapi.core.utilities import MAX_LIMIT, bbox2polygon @@ -26,7 +25,6 @@ AsyncOpensearchSettings as AsyncSearchSettings, ) from stac_fastapi.opensearch.config import OpensearchSettings as SyncSearchSettings -from stac_fastapi.sfeos_helpers import filter as filter_module from stac_fastapi.sfeos_helpers.database import ( apply_free_text_filter_shared, apply_intersects_filter_shared, @@ -66,6 +64,9 @@ from stac_fastapi.types.errors import ConflictError, NotFoundError from stac_fastapi.types.links import resolve_links from stac_fastapi.types.stac import Collection, Item +from starlette.requests import Request + +from stac_fastapi.sfeos_helpers import filter as filter_module logger = logging.getLogger(__name__) @@ -387,19 +388,17 @@ def apply_bbox_filter(search: Search, bbox: List): a geo_shape filter is added to the search object, set to intersect with the specified polygon. """ return search.filter( - Q( - { - "geo_shape": { - "geometry": { - "shape": { - "type": "polygon", - "coordinates": bbox2polygon(*bbox), - }, - "relation": "intersects", - } + Q({ + "geo_shape": { + "geometry": { + "shape": { + "type": "polygon", + "coordinates": bbox2polygon(*bbox), + }, + "relation": "intersects", } } - ) + }) ) @staticmethod @@ -679,14 +678,21 @@ async def async_prep_create_item( """ await self.check_collection_exists(collection_id=item["collection"]) + alias = index_alias_by_collection_id(item["collection"]) + doc_id = mk_item_id(item["id"], item["collection"]) - if not exist_ok and await self.client.exists( - index=index_alias_by_collection_id(item["collection"]), - id=mk_item_id(item["id"], item["collection"]), - ): - raise ConflictError( - f"Item {item['id']} in collection {item['collection']} already exists" - ) + if not exist_ok: + alias_exists = await self.client.indices.exists_alias(name=alias) + + if alias_exists: + alias_info = await self.client.indices.get_alias(name=alias) + indices = list(alias_info.keys()) + + for index in indices: + if await self.client.exists(index=index, id=doc_id): + raise ConflictError( + f"Item {item['id']} in collection {item['collection']} already exists" + ) return self.item_serializer.stac_to_db(item, base_url) @@ -903,7 +909,6 @@ async def json_patch_item( "add", "replace", ]: - if operation.path == "collection" and collection_id != operation.value: await self.check_collection_exists(collection_id=operation.value) new_collection_id = operation.value @@ -957,8 +962,8 @@ async def json_patch_item( "script": { "lang": "painless", "source": ( - f"""ctx._id = ctx._id.replace('{collection_id}', '{new_collection_id}');""" # noqa: E702 - f"""ctx._source.collection = '{new_collection_id}';""" # noqa: E702 + f"""ctx._id = ctx._id.replace('{collection_id}', '{new_collection_id}');""" + f"""ctx._source.collection = '{new_collection_id}';""" ), }, }, @@ -1180,7 +1185,7 @@ async def update_collection( "source": {"index": f"{ITEMS_INDEX_PREFIX}{collection_id}"}, "script": { "lang": "painless", - "source": f"""ctx._id = ctx._id.replace('{collection_id}', '{collection["id"]}'); ctx._source.collection = '{collection["id"]}' ;""", # noqa: E702 + "source": f"""ctx._id = ctx._id.replace('{collection_id}', '{collection["id"]}'); ctx._source.collection = '{collection["id"]}' ;""", }, }, wait_for_completion=True, From 20b576faf3193d02540d9cc83bcfe0cefb79a133 Mon Sep 17 00:00:00 2001 From: Marcin Niemyjski Date: Tue, 23 Sep 2025 12:51:56 +0200 Subject: [PATCH 7/9] updated changelog --- CHANGELOG.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8602fba50..f76348479 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - ## [Unreleased] ### Changed +- Fixed a bug where missing 'copy()'' caused default queryables to be incorrectly enriched by results from previous queries. [#427](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/449) +- Removed non-generic attributes ('cloud_cover', 'cloud_shadow_percentage', 'nodata_pixel_percentage') not applicable to all collections (e.g., SAR data).[#427](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/449) +- Updated 'async_prep_create_item' to support OS item loading with multiple indices.[#427](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/449) - updated `numReturned` & `numMatched` fields in itemCollection return to `numberReturned` & `numberMatched`. [#446](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/446) ## [v6.3.0] - 2025-09-16 @@ -45,7 +47,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [v6.2.0] - 2025-08-27 -### Added +### Added - Added comprehensive index management system with dynamic selection and insertion strategies for improved performance and scalability [#405](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/405) - Added `ENABLE_DATETIME_INDEX_FILTERING` environment variable to enable datetime-based index selection using collection IDs. When enabled, the system creates indexes with UUID-based names and manages them through time-based aliases. Default is `false`. [#405](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/405) @@ -79,7 +81,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Added the ability to set timeout for Opensearch and Elasticsearch clients by setting the environmental variable `ES_TIMEOUT` [#408](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/408) -- Added `collection-search#filter` conformance class to CollectionSearchExtension to enable compatibility with stac-auth-proxy collection filtering [#411](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/411) +- Added `collection-search#filter` conformance class to CollectionSearchExtension to enable compatibility with stac-auth-proxy collection filtering [#411](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/411) ### Changed @@ -91,7 +93,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added -- Added support for PATCH update through [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902) and [RFC 7396](https://datatracker.ietf.org/doc/html/rfc7396) [#291](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/291) +- Added support for PATCH update through [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902) and [RFC 7396](https://datatracker.ietf.org/doc/html/rfc7396) [#291](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/291) ### Changed @@ -133,7 +135,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Removed `requests` dev dependency [#395](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/395) - ## [v4.2.0] - 2025-05-15 ### Added @@ -176,12 +177,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [v4.0.0] - 2025-04-23 ### Added + - Added support for dynamically-generated queryables based on Elasticsearch/OpenSearch mappings, with extensible metadata augmentation [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351) - Included default queryables configuration for seamless integration. [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351) - Added support for high-performance direct response mode for both Elasticsearch and Opensearch backends, controlled by the `ENABLE_DIRECT_RESPONSE` environment variable. When enabled (`ENABLE_DIRECT_RESPONSE=true`), endpoints return Starlette Response objects directly, bypassing FastAPI's jsonable_encoder and Pydantic serialization for significantly improved performance on large search responses. **Note:** In this mode, all FastAPI dependencies (including authentication, custom status codes, and validation) are disabled for all routes. Default is `false` for safety. A warning is logged at startup if enabled. See [issue #347](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/issues/347) and [PR #359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359). - Added robust tests for the `ENABLE_DIRECT_RESPONSE` environment variable, covering both Elasticsearch and OpenSearch backends. Tests gracefully handle missing backends by attempting to import both configs and skipping if neither is available. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359) ### Changed + - Refactored database logic to reduce duplication [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351) - Replaced `fastapi-slim` with `fastapi` dependency [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351) - Changed minimum Python version to 3.9 [#354](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/354) @@ -207,6 +210,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Refactored all boolean environment variable parsing in both Elasticsearch and OpenSearch backends to use the shared `get_bool_env` utility. This ensures robust and consistent handling of environment variables such as `ES_USE_SSL`, `ES_HTTP_COMPRESS`, and `ES_VERIFY_CERTS` across both backends. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359) ### Fixed + - Improved performance of `mk_actions` and `filter-links` methods [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351) - Fixed inheritance relating to BaseDatabaseSettings and ApiBaseSettings [#355](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/355) - Fixed delete_item and delete_collection methods return types [#355](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/355) From b4e075d33793c1dde693da823268f447289da4cf Mon Sep 17 00:00:00 2001 From: Marcin Niemyjski Date: Tue, 23 Sep 2025 12:52:50 +0200 Subject: [PATCH 8/9] lint edits --- .../stac_fastapi/opensearch/database_logic.py | 26 ++++++++++--------- .../sfeos_helpers/filter/client.py | 10 ++++--- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py b/stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py index b79d4800a..57ee14670 100644 --- a/stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py +++ b/stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py @@ -13,6 +13,8 @@ from opensearchpy import exceptions, helpers from opensearchpy.helpers.query import Q from opensearchpy.helpers.search import Search +from starlette.requests import Request + from stac_fastapi.core.base_database_logic import BaseDatabaseLogic from stac_fastapi.core.serializers import CollectionSerializer, ItemSerializer from stac_fastapi.core.utilities import bbox2polygon, get_max_limit @@ -25,6 +27,7 @@ AsyncOpensearchSettings as AsyncSearchSettings, ) from stac_fastapi.opensearch.config import OpensearchSettings as SyncSearchSettings +from stac_fastapi.sfeos_helpers import filter as filter_module from stac_fastapi.sfeos_helpers.database import ( apply_free_text_filter_shared, apply_intersects_filter_shared, @@ -64,9 +67,6 @@ from stac_fastapi.types.errors import ConflictError, NotFoundError from stac_fastapi.types.links import resolve_links from stac_fastapi.types.stac import Collection, Item -from starlette.requests import Request - -from stac_fastapi.sfeos_helpers import filter as filter_module logger = logging.getLogger(__name__) @@ -388,17 +388,19 @@ def apply_bbox_filter(search: Search, bbox: List): a geo_shape filter is added to the search object, set to intersect with the specified polygon. """ return search.filter( - Q({ - "geo_shape": { - "geometry": { - "shape": { - "type": "polygon", - "coordinates": bbox2polygon(*bbox), - }, - "relation": "intersects", + Q( + { + "geo_shape": { + "geometry": { + "shape": { + "type": "polygon", + "coordinates": bbox2polygon(*bbox), + }, + "relation": "intersects", + } } } - }) + ) ) @staticmethod diff --git a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py index 8a9cf4284..6ad6bf925 100644 --- a/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py +++ b/stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py @@ -53,10 +53,12 @@ async def get_queryables( return queryables properties: Dict[str, Any] = queryables["properties"].copy() - queryables.update({ - "properties": properties, - "additionalProperties": False, - }) + queryables.update( + { + "properties": properties, + "additionalProperties": False, + } + ) mapping_data = await self.database.get_items_mapping(collection_id) mapping_properties = next(iter(mapping_data.values()))["mappings"]["properties"] From 3d9a90662b6fc472001a800d1d30caea84737f00 Mon Sep 17 00:00:00 2001 From: Marcin <106817115+MathewNWSH@users.noreply.github.com> Date: Tue, 23 Sep 2025 12:57:51 +0200 Subject: [PATCH 9/9] fix changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f76348479..6918b1abd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed -- Fixed a bug where missing 'copy()'' caused default queryables to be incorrectly enriched by results from previous queries. [#427](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/449) -- Removed non-generic attributes ('cloud_cover', 'cloud_shadow_percentage', 'nodata_pixel_percentage') not applicable to all collections (e.g., SAR data).[#427](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/449) -- Updated 'async_prep_create_item' to support OS item loading with multiple indices.[#427](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/449) +- Fixed a bug where missing `copy()` caused default queryables to be incorrectly enriched by results from previous queries. [#427](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/449) +- Removed non-generic attributes (`cloud_cover`, `cloud_shadow_percentage`, `nodata_pixel_percentage`) not applicable to all collections (e.g., SAR data).[#427](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/449) +- Updated `async_prep_create_item` to support OS item loading with multiple indices.[#427](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/449) - updated `numReturned` & `numMatched` fields in itemCollection return to `numberReturned` & `numberMatched`. [#446](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/446) ## [v6.3.0] - 2025-09-16