You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
10
10
### Added
11
11
12
12
- GET `/collections` collection search structured filter extension with support for both cql2-json and cql2-text formats. [#475](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/475)
13
+
- GET `/collections` collections search datetime filtering support. [#476](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/476)
Copy file name to clipboardExpand all lines: README.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,11 +138,19 @@ SFEOS implements extended capabilities for the `/collections` endpoint, allowing
138
138
- Supports both CQL2 JSON and CQL2 text formats with various operators
139
139
- Enables precise filtering on any collection property
140
140
141
-
> **Note on HTTP Methods**: All collection search extensions (sorting, field selection, free text search, and structured filtering) currently only support GET requests. POST requests with these parameters in the request body are not yet supported.
141
+
-**Datetime Filtering**: Filter collections by their temporal extent using the `datetime` parameter
142
+
- Example: `/collections?datetime=2020-01-01T00:00:00Z/2020-12-31T23:59:59Z` (finds collections with temporal extents that overlap this range)
143
+
- Example: `/collections?datetime=2020-06-15T12:00:00Z` (finds collections whose temporal extent includes this specific time)
144
+
- Example: `/collections?datetime=2020-01-01T00:00:00Z/..` (finds collections with temporal extents that extend to or beyond January 1, 2020)
145
+
- Example: `/collections?datetime=../2020-12-31T23:59:59Z` (finds collections with temporal extents that begin on or before December 31, 2020)
146
+
- Collections are matched if their temporal extent overlaps with the provided datetime parameter
147
+
- This allows for efficient discovery of collections based on time periods
148
+
149
+
> **Note on HTTP Methods**: All collection search extensions (sorting, field selection, free text search, structured filtering, and datetime filtering) currently only support GET requests. POST requests with these parameters in the request body are not yet supported.
142
150
143
151
These extensions make it easier to build user interfaces that display and navigate through collections efficiently.
144
152
145
-
> **Configuration**: Collection search extensions (sorting, field selection, free text search, and structured filtering) can be disabled by setting the `ENABLE_COLLECTIONS_SEARCH` environment variable to `false`. By default, these extensions are enabled.
153
+
> **Configuration**: Collection search extensions (sorting, field selection, free text search, structured filtering, and datetime filtering) can be disabled by setting the `ENABLE_COLLECTIONS_SEARCH` environment variable to `false`. By default, these extensions are enabled.
146
154
147
155
> **Note**: Sorting is only available on fields that are indexed for sorting in Elasticsearch/OpenSearch. With the default mappings, you can sort on:
148
156
> -`id` (keyword field)
@@ -283,12 +291,12 @@ You can customize additional settings in your `.env` file:
283
291
|`ENABLE_DIRECT_RESPONSE`| Enable direct response for maximum performance (disables all FastAPI dependencies, including authentication, custom status codes, and validation) |`false`| Optional |
284
292
|`RAISE_ON_BULK_ERROR`| Controls whether bulk insert operations raise exceptions on errors. If set to `true`, the operation will stop and raise an exception when an error occurs. If set to `false`, errors will be logged, and the operation will continue. **Note:** STAC Item and ItemCollection validation errors will always raise, regardless of this flag. |`false`| Optional |
285
293
|`DATABASE_REFRESH`| Controls whether database operations refresh the index immediately after changes. If set to `true`, changes will be immediately searchable. If set to `false`, changes may not be immediately visible but can improve performance for bulk operations. If set to `wait_for`, changes will wait for the next refresh cycle to become visible. |`false`| Optional |
|`ENABLE_COLLECTIONS_SEARCH`| Enable collection search extensions (sort, fields, free text search, structured filtering, and datetime filtering). |`true`| Optional |
287
295
|`ENABLE_TRANSACTIONS_EXTENSIONS`| Enables or disables the Transactions and Bulk Transactions API extensions. If set to `false`, the POST `/collections` route and related transaction endpoints (including bulk transaction operations) will be unavailable in the API. This is useful for deployments where mutating the catalog via the API should be prevented. |`true`| Optional |
288
296
|`STAC_ITEM_LIMIT`| Sets the environment variable for result limiting to SFEOS for the number of returned items and STAC collections. |`10`| Optional |
289
297
|`STAC_INDEX_ASSETS`| Controls if Assets are indexed when added to Elasticsearch/Opensearch. This allows asset fields to be included in search queries. |`false`| Optional |
290
298
|`ENV_MAX_LIMIT`| Configures the environment variable in SFEOS to override the default `MAX_LIMIT`, which controls the limit parameter for returned items and STAC collections. |`10,000`| Optional |
291
-
|`USE_DATETIME`| Configures the datetime search behavior in SFEOS. When enabled, searches both datetime field and falls back to start_datetime/end_datetime range for items with null datetime. When disabled, searches only by start_datetime/end_datetime range. | True| Optional |
299
+
|`USE_DATETIME`| Configures the datetime search behavior in SFEOS. When enabled, searches both datetime field and falls back to start_datetime/end_datetime range for items with null datetime. When disabled, searches only by start_datetime/end_datetime range. This applies to both item searches and collection searches. |`true`| Optional |
292
300
293
301
> [!NOTE]
294
302
> The variables `ES_HOST`, `ES_PORT`, `ES_USE_SSL`, `ES_VERIFY_CERTS` and `ES_TIMEOUT` apply to both Elasticsearch and OpenSearch backends, so there is no need to rename the key names to `OS_` even if you're using OpenSearch.
0 commit comments