Skip to content

Commit 590ccb3

Browse files
author
Grzegorz Pustulka
committed
ready for code review
1 parent 59d43f9 commit 590ccb3

File tree

32 files changed

+2189
-153
lines changed

32 files changed

+2189
-153
lines changed

.github/workflows/cicd.yml

Lines changed: 3 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

CHANGELOG.md

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

99
## [Unreleased]
1010

11+
### Added
12+
13+
- 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)
14+
- Added `ENABLE_DATETIME_INDEX_FILTERING` environment variable to enable datetime-based index selection using collection IDs. Requires indexes in format: `STAC_ITEMS_INDEX_PREFIX_collection-id_start_year-start_month-start_day-end_year-end_month-end_day`, e.g. `items_sentinel-2-l2a_2025-06-06-2025-09-22`. Default is `false`. [#405](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/405)
15+
- 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. 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)
16+
- Added search engine adapter system with support for both Elasticsearch and OpenSearch [#405](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/405):
17+
- `SearchEngineAdapter` base class with engine-specific implementations
18+
- `ElasticsearchAdapter` and `OpenSearchAdapter` with tailored index creation methods
19+
- Automatic engine type detection based on client class
20+
- `SearchEngineAdapterFactory` for creating appropriate adapters
21+
- Added datetime-based index selection strategies with caching support [#405](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/405):
22+
- `AsyncDatetimeBasedIndexSelector` and `SyncDatetimeBasedIndexSelector` for temporal filtering
23+
- `IndexCacheManager` with configurable TTL-based cache expiration (default 1 hour)
24+
- `AsyncIndexAliasLoader` and `SyncIndexAliasLoader` for alias management
25+
- `UnfilteredIndexSelector` as fallback for returning all available indexes
26+
- Added index insertion strategies with automatic partitioning [#405](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/405):
27+
- Simple insertion strategy (`AsyncSimpleIndexInserter`, `SyncSimpleIndexInserter`) for traditional single-index-per-collection approach
28+
- Datetime-based insertion strategy (`AsyncDatetimeIndexInserter`, `SyncDatetimeIndexInserter`) with time-based partitioning
29+
- Automatic index size monitoring and splitting when limits exceeded
30+
- Handling of chronologically early data and bulk operations
31+
- Added index management utilities [#405](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/405):
32+
- `IndexSizeManager` for size monitoring and overflow handling
33+
- `DatetimeIndexManager` for datetime-based index operations
34+
- Factory patterns (`IndexInsertionFactory`, `IndexSelectorFactory`) for strategy creation based on configuration
35+
36+
1137
## [v6.1.0] - 2025-07-24
1238

1339
### Added

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)