Skip to content

Commit 03ca82a

Browse files
authored
Merge branch 'main' into collection-search-get-request
2 parents 80ae53f + 479d734 commit 03ca82a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3360
-396
lines changed

.github/workflows/cicd.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
xpack.security.enabled: false
2929
xpack.security.transport.ssl.enabled: false
3030
ES_JAVA_OPTS: -Xms512m -Xmx1g
31+
action.destructive_requires_name: false
3132
ports:
3233
- 9200:9200
3334

@@ -44,6 +45,7 @@ jobs:
4445
xpack.security.enabled: false
4546
xpack.security.transport.ssl.enabled: false
4647
ES_JAVA_OPTS: -Xms512m -Xmx1g
48+
action.destructive_requires_name: false
4749
ports:
4850
- 9400:9400
4951

@@ -60,6 +62,7 @@ jobs:
6062
plugins.security.disabled: true
6163
plugins.security.ssl.http.enabled: true
6264
OPENSEARCH_JAVA_OPTS: -Xms512m -Xmx512m
65+
action.destructive_requires_name: false
6366
ports:
6467
- 9202:9202
6568

@@ -120,5 +123,6 @@ jobs:
120123
ES_PORT: ${{ matrix.backend == 'elasticsearch7' && '9400' || matrix.backend == 'elasticsearch8' && '9200' || '9202' }}
121124
ES_HOST: 172.17.0.1
122125
ES_USE_SSL: false
126+
DATABASE_REFRESH: true
123127
ES_VERIFY_CERTS: false
124128
BACKEND: ${{ matrix.backend == 'elasticsearch7' && 'elasticsearch' || matrix.backend == 'elasticsearch8' && 'elasticsearch' || 'opensearch' }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
# E501 let black handle all line length decisions
1717
# W503 black conflicts with "line break before operator" rule
1818
# E203 black conflicts with "whitespace before ':'" rule
19-
'--ignore=E501,W503,E203,C901,E231' ]
19+
'--ignore=E501,W503,E203,C901,E231,E702' ]
2020
- repo: https://github.com/pre-commit/mirrors-mypy
2121
rev: v0.991
2222
hooks:

CHANGELOG.md

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

1313
- Added support for Collections search
1414

15+
### Changed
16+
17+
- updated `numReturned` & `numMatched` fields in itemCollection return to `numberReturned` & `numberMatched`. [#446](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/446)
18+
19+
## [v6.3.0] - 2025-09-16
20+
21+
### Added
22+
23+
- `STAC_INDEX_ASSETS` environment variable to allow asset serialization to be configurable. [#433](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/433)
24+
- Added the `ENV_MAX_LIMIT` environment variable to SFEOS, allowing overriding of the `MAX_LIMIT`, which controls the `?limit` parameter for returned items and STAC collections. [#434](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/434)
25+
- Sort, Query, and Filter extension and functionality to the item collection route. [#437](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/437)
26+
- Added Fields Extension implementation for the `/collections/{collection_id}/items` endpoint. [#436](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/436)
27+
28+
### Changed
29+
30+
- Changed assets serialization to prevent mapping explosion while allowing asset information to be indexed. [#341](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/341)
31+
- Simplified the item_collection function in core.py, moving the request to the get_search function. [#437](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/437)
32+
- Updated the `format_datetime_range` function to support milliseconds. [#423](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/423)
33+
- Blocked the /collections/{collection_id}/bulk_items endpoint when environmental variable ENABLE_DATETIME_INDEX_FILTERING is set to true. [#438](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/438)
34+
35+
### Fixed
36+
37+
- Fixed issue where sortby was not accepting the default sort, where a + or - was not specified before the field value ie. localhost:8081/collections/{collection_id}/items?sortby=id. [#437](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/437)
38+
39+
## [v6.2.1] - 2025-09-02
40+
41+
### Added
42+
43+
- 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)
44+
- 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)
45+
46+
### Changed
47+
48+
- 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)
49+
50+
## [v6.2.0] - 2025-08-27
51+
52+
### Added
53+
54+
- 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)
55+
- 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)
56+
- Added `DATETIME_INDEX_MAX_SIZE_GB` environment variable to set maximum size limit in GB for datetime-based indexes. When an index exceeds this size, a new time-partitioned index will be created. Note: add +20% to target size due to ES/OS compression. Default is `25` GB. Only applies when `ENABLE_DATETIME_INDEX_FILTERING` is enabled. [#405](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/405)
57+
- Added index operations system with unified interface for both Elasticsearch and OpenSearch [#405](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/405):
58+
- `IndexOperations` class with common index creation and management methods
59+
- UUID-based physical index naming: `{prefix}_{collection-id}_{uuid4}`
60+
- Alias management: main collection alias, temporal aliases, and closed index aliases
61+
- Automatic alias updates when indexes reach size limits
62+
- Added datetime-based index selection strategies with caching support [#405](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/405):
63+
- `DatetimeBasedIndexSelector` for temporal filtering with intelligent caching
64+
- `IndexCacheManager` with configurable TTL-based cache expiration (default 1 hour)
65+
- `IndexAliasLoader` for alias management and cache refresh
66+
- `UnfilteredIndexSelector` as fallback for returning all available indexes
67+
- Added index insertion strategies with automatic partitioning [#405](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/405):
68+
- Simple insertion strategy (`SimpleIndexInserter`) for traditional single-index-per-collection approach
69+
- Datetime-based insertion strategy (`DatetimeIndexInserter`) with time-based partitioning
70+
- Automatic index size monitoring and splitting when limits exceeded
71+
- Handling of chronologically early data and bulk operations
72+
- Added index management utilities [#405](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/405):
73+
- `IndexSizeManager` for size monitoring and overflow handling with compression awareness
74+
- `DatetimeIndexManager` for datetime-based index operations and validation
75+
- Factory patterns (`IndexInsertionFactory`, `IndexSelectorFactory`) for strategy creation based on configuration
76+
77+
### Changed
78+
79+
- Added the Datetime-Based Index Management section to the Table of Contents in the readme, updating heading sizes to match the rest of the document [#418](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/418)
80+
81+
## [v6.1.0] - 2025-07-24
82+
83+
### Added
84+
85+
- 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)
86+
- 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)
87+
88+
### Changed
89+
90+
- Updated collection to index logic to support searching a large amount of indices [#412](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/412)
91+
- Updated documentation to reflect use of ES environment variables [#410](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/410)
92+
- Updated documentation to reflect `APP_PORT` in [stac-fastapi-core ApiSettings](https://github.com/stac-utils/stac-fastapi/blob/fa42985255fad0bab7dbe3aadbf1f74cb1635f3a/stac_fastapi/types/stac_fastapi/types/config.py#L30) [#410](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/410)
93+
1594
## [v6.0.0] - 2025-06-22
1695

1796
### Added
@@ -433,7 +512,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
433512
- Use genexp in execute_search and get_all_collections to return results.
434513
- Added db_to_stac serializer to item_collection method in core.py.
435514

436-
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.0.0...main
515+
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.3.0...main
516+
[v6.3.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.2.1...v6.3.0
517+
[v6.2.1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.2.0...v6.2.1
518+
[v6.2.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.1.0...v6.2.0
519+
[v6.1.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.0.0...v6.1.0
437520
[v6.0.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v5.0.0...v6.0.0
438521
[v5.0.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.2.0...v5.0.0
439522
[v4.2.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.1.0...v4.2.0

Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ run_os = docker compose \
2727
.PHONY: image-deploy-es
2828
image-deploy-es:
2929
docker build -f dockerfiles/Dockerfile.dev.es -t stac-fastapi-elasticsearch:latest .
30-
30+
3131
.PHONY: image-deploy-os
3232
image-deploy-os:
3333
docker build -f dockerfiles/Dockerfile.dev.os -t stac-fastapi-opensearch:latest .
@@ -71,14 +71,19 @@ test-opensearch:
7171
-$(run_os) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh opensearch:9202 && cd stac_fastapi/tests/ && pytest'
7272
docker compose down
7373

74-
.PHONY: test
75-
test:
76-
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd stac_fastapi/tests/ && pytest --cov=stac_fastapi --cov-report=term-missing'
74+
.PHONY: test-datetime-filtering-es
75+
test-datetime-filtering-es:
76+
-$(run_es) /bin/bash -c 'export ENABLE_DATETIME_INDEX_FILTERING=true && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd stac_fastapi/tests/ && pytest -s --cov=stac_fastapi --cov-report=term-missing -m datetime_filtering'
7777
docker compose down
7878

79-
-$(run_os) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh opensearch:9202 && cd stac_fastapi/tests/ && pytest --cov=stac_fastapi --cov-report=term-missing'
79+
.PHONY: test-datetime-filtering-os
80+
test-datetime-filtering-os:
81+
-$(run_os) /bin/bash -c 'export ENABLE_DATETIME_INDEX_FILTERING=true && ./scripts/wait-for-it-es.sh opensearch:9202 && cd stac_fastapi/tests/ && pytest -s --cov=stac_fastapi --cov-report=term-missing -m datetime_filtering'
8082
docker compose down
8183

84+
.PHONY: test
85+
test: test-elasticsearch test-datetime-filtering-es test-opensearch test-datetime-filtering-os
86+
8287
.PHONY: run-database-es
8388
run-database-es:
8489
docker compose run --rm elasticsearch

0 commit comments

Comments
 (0)