Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed

[v6.5.1] - 2025-09-30

### Fixed

- Issue where token, query param was not being passed to POST collections search logic [#483](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/483)
- Issue where datetime param was not being passed from POST collections search logic to Elasticsearch [#483](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/483)
- Collections search tests to ensure both GET /collections and GET/POST /collections-search endpoints are tested [#483](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/483)

[v6.5.0] - 2025-09-29

### Added
Expand Down Expand Up @@ -547,7 +555,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Use genexp in execute_search and get_all_collections to return results.
- Added db_to_stac serializer to item_collection method in core.py.

[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.5.0...main
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.5.1...main
[v6.5.1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.5.0...v6.5.1
[v6.5.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.4.0...v6.5.0
[v6.4.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.3.0...v6.4.0
[v6.3.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.2.1...v6.3.0
Expand Down
2 changes: 2 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
- ES_VERIFY_CERTS=false
- BACKEND=elasticsearch
- DATABASE_REFRESH=true
- ENABLE_COLLECTIONS_SEARCH_ROUTE=true
ports:
- "8080:8080"
volumes:
Expand Down Expand Up @@ -56,6 +57,7 @@ services:
- ES_VERIFY_CERTS=false
- BACKEND=opensearch
- STAC_FASTAPI_RATE_LIMIT=200/minute
- ENABLE_COLLECTIONS_SEARCH_ROUTE=true
ports:
- "8082:8082"
volumes:
Expand Down
13 changes: 10 additions & 3 deletions stac_fastapi/core/stac_fastapi/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,16 @@ async def landing_page(self, **kwargs) -> stac_types.LandingPage:

async def all_collections(
self,
datetime: Optional[str] = None,
limit: Optional[int] = None,
datetime: Optional[str] = None,
fields: Optional[List[str]] = None,
sortby: Optional[Union[str, List[str]]] = None,
filter_expr: Optional[str] = None,
filter_lang: Optional[str] = None,
q: Optional[Union[str, List[str]]] = None,
query: Optional[str] = None,
request: Request = None,
token: Optional[str] = None,
**kwargs,
) -> stac_types.Collections:
"""Read all collections from the database.
Expand All @@ -266,7 +268,6 @@ async def all_collections(
Returns:
A Collections object containing all the collections in the database and links to various resources.
"""
request = kwargs["request"]
base_url = str(request.base_url)

# Get the global limit from environment variable
Expand Down Expand Up @@ -298,7 +299,9 @@ async def all_collections(
else:
limit = 10

token = request.query_params.get("token")
# Get token from query params only if not already provided (for GET requests)
if token is None:
token = request.query_params.get("token")

# Process fields parameter for filtering collection properties
includes, excludes = set(), set()
Expand Down Expand Up @@ -499,6 +502,10 @@ async def post_all_collections(
# Pass all parameters from search_request to all_collections
return await self.all_collections(
limit=search_request.limit if hasattr(search_request, "limit") else None,
datetime=search_request.datetime
if hasattr(search_request, "datetime")
else None,
token=search_request.token if hasattr(search_request, "token") else None,
fields=fields,
sortby=sortby,
filter_expr=search_request.filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class CollectionsSearchRequest(ExtendedSearch):
"""Extended search model for collections with free text search support."""

q: Optional[Union[str, List[str]]] = None
token: Optional[str] = None
query: Optional[
str
] = None # Legacy query extension (deprecated but still supported)


class CollectionsSearchEndpointExtension(ApiExtension):
Expand Down
2 changes: 1 addition & 1 deletion stac_fastapi/core/stac_fastapi/core/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""library version."""
__version__ = "6.5.0"
__version__ = "6.5.1"
4 changes: 2 additions & 2 deletions stac_fastapi/elasticsearch/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
desc = f.read()

install_requires = [
"stac-fastapi-core==6.5.0",
"sfeos-helpers==6.5.0",
"stac-fastapi-core==6.5.1",
"sfeos-helpers==6.5.1",
"elasticsearch[async]~=8.18.0",
"uvicorn~=0.23.0",
"starlette>=0.35.0,<0.36.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ async def get_all_collections(
query_parts.append(search_dict["query"])

except Exception as e:
logger = logging.getLogger(__name__)
logger.error(f"Error converting query to Elasticsearch: {e}")
# If there's an error, add a query that matches nothing
query_parts.append({"bool": {"must_not": {"match_all": {}}}})
Expand Down Expand Up @@ -381,7 +380,6 @@ async def get_all_collections(
try:
matched = count_task.result().get("count")
except Exception as e:
logger = logging.getLogger(__name__)
logger.error(f"Count task failed: {e}")

return collections, next_token, matched
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""library version."""
__version__ = "6.5.0"
__version__ = "6.5.1"
4 changes: 2 additions & 2 deletions stac_fastapi/opensearch/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
desc = f.read()

install_requires = [
"stac-fastapi-core==6.5.0",
"sfeos-helpers==6.5.0",
"stac-fastapi-core==6.5.1",
"sfeos-helpers==6.5.1",
"opensearch-py~=2.8.0",
"opensearch-py[async]~=2.8.0",
"uvicorn~=0.23.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ async def get_all_collections(
query_parts.append(search_dict["query"])

except Exception as e:
logger = logging.getLogger(__name__)
logger.error(f"Error converting query to OpenSearch: {e}")
# If there's an error, add a query that matches nothing
query_parts.append({"bool": {"must_not": {"match_all": {}}}})
Expand Down Expand Up @@ -365,7 +364,6 @@ async def get_all_collections(
try:
matched = count_task.result().get("count")
except Exception as e:
logger = logging.getLogger(__name__)
logger.error(f"Count task failed: {e}")

return collections, next_token, matched
Expand Down
2 changes: 1 addition & 1 deletion stac_fastapi/opensearch/stac_fastapi/opensearch/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""library version."""
__version__ = "6.5.0"
__version__ = "6.5.1"
2 changes: 1 addition & 1 deletion stac_fastapi/sfeos_helpers/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
desc = f.read()

install_requires = [
"stac-fastapi.core==6.5.0",
"stac-fastapi.core==6.5.1",
]

setup(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""library version."""
__version__ = "6.5.0"
__version__ = "6.5.1"
Loading