sfeos-helpers 6.4.0__tar.gz → 6.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/PKG-INFO +32 -10
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/README.md +31 -9
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/setup.py +1 -1
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/sfeos_helpers.egg-info/PKG-INFO +32 -10
- sfeos_helpers-6.5.0/sfeos_helpers.egg-info/requires.txt +1 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/filter/client.py +3 -1
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/mappings.py +4 -1
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/version.py +1 -1
- sfeos_helpers-6.4.0/sfeos_helpers.egg-info/requires.txt +0 -1
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/setup.cfg +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/sfeos_helpers.egg-info/SOURCES.txt +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/sfeos_helpers.egg-info/dependency_links.txt +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/sfeos_helpers.egg-info/not-zip-safe +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/sfeos_helpers.egg-info/top_level.txt +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/aggregation/__init__.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/aggregation/client.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/aggregation/format.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/database/__init__.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/database/datetime.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/database/document.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/database/index.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/database/mapping.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/database/query.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/database/utils.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/filter/__init__.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/filter/cql2.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/filter/transform.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/models/patch.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/__init__.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/base.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/factory.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/index_operations.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/inserters.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/managers.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/selection/__init__.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/selection/base.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/selection/cache_manager.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/selection/factory.py +0 -0
- {sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/selection/selectors.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sfeos_helpers
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.5.0
|
|
4
4
|
Summary: Helper library for the Elasticsearch and Opensearch stac-fastapi backends.
|
|
5
5
|
Home-page: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch
|
|
6
6
|
License: MIT
|
|
@@ -84,13 +84,13 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
|
|
|
84
84
|
## Table of Contents
|
|
85
85
|
|
|
86
86
|
- [stac-fastapi-elasticsearch-opensearch](#stac-fastapi-elasticsearch-opensearch)
|
|
87
|
-
- [Sponsors
|
|
87
|
+
- [Sponsors & Supporters](#sponsors--supporters)
|
|
88
88
|
- [Project Introduction - What is SFEOS?](#project-introduction---what-is-sfeos)
|
|
89
89
|
- [Common Deployment Patterns](#common-deployment-patterns)
|
|
90
90
|
- [Technologies](#technologies)
|
|
91
91
|
- [Table of Contents](#table-of-contents)
|
|
92
92
|
- [Collection Search Extensions](#collection-search-extensions)
|
|
93
|
-
- [Documentation
|
|
93
|
+
- [Documentation & Resources](#documentation--resources)
|
|
94
94
|
- [Package Structure](#package-structure)
|
|
95
95
|
- [Examples](#examples)
|
|
96
96
|
- [Performance](#performance)
|
|
@@ -133,7 +133,11 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
|
|
|
133
133
|
|
|
134
134
|
## Collection Search Extensions
|
|
135
135
|
|
|
136
|
-
SFEOS
|
|
136
|
+
SFEOS provides enhanced collection search capabilities through two primary routes:
|
|
137
|
+
- **GET/POST `/collections`**: The standard STAC endpoint with extended query parameters
|
|
138
|
+
- **GET/POST `/collections-search`**: A custom endpoint that supports the same parameters, created to avoid conflicts with the STAC Transactions extension if enabled (which uses POST `/collections` for collection creation)
|
|
139
|
+
|
|
140
|
+
These endpoints support advanced collection discovery features including:
|
|
137
141
|
|
|
138
142
|
- **Sorting**: Sort collections by sortable fields using the `sortby` parameter
|
|
139
143
|
- Example: `/collections?sortby=+id` (ascending sort by ID)
|
|
@@ -149,9 +153,26 @@ SFEOS implements extended capabilities for the `/collections` endpoint, allowing
|
|
|
149
153
|
- Searches across multiple text fields including title, description, and keywords
|
|
150
154
|
- Supports partial word matching and relevance-based sorting
|
|
151
155
|
|
|
156
|
+
- **Structured Filtering**: Filter collections using CQL2 expressions
|
|
157
|
+
- JSON format: `/collections?filter={"op":"=","args":[{"property":"id"},"sentinel-2"]}&filter-lang=cql2-json`
|
|
158
|
+
- Text format: `/collections?filter=id='sentinel-2'&filter-lang=cql2-text` (note: string values must be quoted)
|
|
159
|
+
- Advanced text format: `/collections?filter=id LIKE '%sentinel%'&filter-lang=cql2-text` (supports LIKE, BETWEEN, etc.)
|
|
160
|
+
- Supports both CQL2 JSON and CQL2 text formats with various operators
|
|
161
|
+
- Enables precise filtering on any collection property
|
|
162
|
+
|
|
163
|
+
- **Datetime Filtering**: Filter collections by their temporal extent using the `datetime` parameter
|
|
164
|
+
- Example: `/collections?datetime=2020-01-01T00:00:00Z/2020-12-31T23:59:59Z` (finds collections with temporal extents that overlap this range)
|
|
165
|
+
- Example: `/collections?datetime=2020-06-15T12:00:00Z` (finds collections whose temporal extent includes this specific time)
|
|
166
|
+
- Example: `/collections?datetime=2020-01-01T00:00:00Z/..` (finds collections with temporal extents that extend to or beyond January 1, 2020)
|
|
167
|
+
- Example: `/collections?datetime=../2020-12-31T23:59:59Z` (finds collections with temporal extents that begin on or before December 31, 2020)
|
|
168
|
+
- Collections are matched if their temporal extent overlaps with the provided datetime parameter
|
|
169
|
+
- This allows for efficient discovery of collections based on time periods
|
|
170
|
+
|
|
152
171
|
These extensions make it easier to build user interfaces that display and navigate through collections efficiently.
|
|
153
172
|
|
|
154
|
-
> **Configuration**: Collection search extensions can be disabled by setting the `ENABLE_COLLECTIONS_SEARCH` environment variable to `false`. By default, these extensions are enabled.
|
|
173
|
+
> **Configuration**: Collection search extensions (sorting, field selection, free text search, structured filtering, and datetime filtering) for the `/collections` endpoint can be disabled by setting the `ENABLE_COLLECTIONS_SEARCH` environment variable to `false`. By default, these extensions are enabled.
|
|
174
|
+
>
|
|
175
|
+
> **Configuration**: The custom `/collections-search` endpoint can be enabled by setting the `ENABLE_COLLECTIONS_SEARCH_ROUTE` environment variable to `true`. By default, this endpoint is **disabled**.
|
|
155
176
|
|
|
156
177
|
> **Note**: Sorting is only available on fields that are indexed for sorting in Elasticsearch/OpenSearch. With the default mappings, you can sort on:
|
|
157
178
|
> - `id` (keyword field)
|
|
@@ -162,6 +183,7 @@ These extensions make it easier to build user interfaces that display and naviga
|
|
|
162
183
|
>
|
|
163
184
|
> **Important**: Adding keyword fields to make text fields sortable can significantly increase the index size, especially for large text fields. Consider the storage implications when deciding which fields to make sortable.
|
|
164
185
|
|
|
186
|
+
|
|
165
187
|
## Package Structure
|
|
166
188
|
|
|
167
189
|
This project is organized into several packages, each with a specific purpose:
|
|
@@ -174,7 +196,7 @@ This project is organized into several packages, each with a specific purpose:
|
|
|
174
196
|
- Shared logic and utilities that improve code reuse between backends
|
|
175
197
|
|
|
176
198
|
- **stac_fastapi_elasticsearch**: Complete implementation of the STAC API using Elasticsearch as the backend database. This package depends on both `stac_fastapi_core` and `sfeos_helpers`.
|
|
177
|
-
|
|
199
|
+
|
|
178
200
|
- **stac_fastapi_opensearch**: Complete implementation of the STAC API using OpenSearch as the backend database. This package depends on both `stac_fastapi_core` and `sfeos_helpers`.
|
|
179
201
|
|
|
180
202
|
## Examples
|
|
@@ -292,12 +314,13 @@ You can customize additional settings in your `.env` file:
|
|
|
292
314
|
| `ENABLE_DIRECT_RESPONSE` | Enable direct response for maximum performance (disables all FastAPI dependencies, including authentication, custom status codes, and validation) | `false` | Optional |
|
|
293
315
|
| `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 |
|
|
294
316
|
| `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 |
|
|
295
|
-
| `ENABLE_COLLECTIONS_SEARCH` | Enable collection search extensions (sort, fields).
|
|
296
|
-
| `
|
|
317
|
+
| `ENABLE_COLLECTIONS_SEARCH` | Enable collection search extensions (sort, fields, free text search, structured filtering, and datetime filtering) on the core `/collections` endpoint. | `true` | Optional |
|
|
318
|
+
| `ENABLE_COLLECTIONS_SEARCH_ROUTE` | Enable the custom `/collections-search` endpoint (both GET and POST methods). When disabled, the custom endpoint will not be available, but collection search extensions will still be available on the core `/collections` endpoint if `ENABLE_COLLECTIONS_SEARCH` is true. | `false` | Optional |
|
|
319
|
+
| `ENABLE_TRANSACTIONS_EXTENSIONS` | Enables or disables the Transactions and Bulk Transactions API extensions. This is useful for deployments where mutating the catalog via the API should be prevented. If set to `true`, the POST `/collections` route for search will be unavailable in the API. | `true` | Optional |
|
|
297
320
|
| `STAC_ITEM_LIMIT` | Sets the environment variable for result limiting to SFEOS for the number of returned items and STAC collections. | `10` | Optional |
|
|
298
321
|
| `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 |
|
|
299
322
|
| `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 |
|
|
300
|
-
| `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. |
|
|
323
|
+
| `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 |
|
|
301
324
|
|
|
302
325
|
> [!NOTE]
|
|
303
326
|
> 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.
|
|
@@ -443,7 +466,6 @@ The system uses a precise naming convention:
|
|
|
443
466
|
- `ENABLE_COLLECTIONS_SEARCH`: Set to `true` (default) to enable collection search extensions (sort, fields). Set to `false` to disable.
|
|
444
467
|
- `ENABLE_TRANSACTIONS_EXTENSIONS`: Set to `true` (default) to enable transaction extensions. Set to `false` to disable.
|
|
445
468
|
|
|
446
|
-
|
|
447
469
|
## Collection Pagination
|
|
448
470
|
|
|
449
471
|
- **Overview**: The collections route supports pagination through optional query parameters.
|
|
@@ -66,13 +66,13 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
|
|
|
66
66
|
## Table of Contents
|
|
67
67
|
|
|
68
68
|
- [stac-fastapi-elasticsearch-opensearch](#stac-fastapi-elasticsearch-opensearch)
|
|
69
|
-
- [Sponsors
|
|
69
|
+
- [Sponsors & Supporters](#sponsors--supporters)
|
|
70
70
|
- [Project Introduction - What is SFEOS?](#project-introduction---what-is-sfeos)
|
|
71
71
|
- [Common Deployment Patterns](#common-deployment-patterns)
|
|
72
72
|
- [Technologies](#technologies)
|
|
73
73
|
- [Table of Contents](#table-of-contents)
|
|
74
74
|
- [Collection Search Extensions](#collection-search-extensions)
|
|
75
|
-
- [Documentation
|
|
75
|
+
- [Documentation & Resources](#documentation--resources)
|
|
76
76
|
- [Package Structure](#package-structure)
|
|
77
77
|
- [Examples](#examples)
|
|
78
78
|
- [Performance](#performance)
|
|
@@ -115,7 +115,11 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
|
|
|
115
115
|
|
|
116
116
|
## Collection Search Extensions
|
|
117
117
|
|
|
118
|
-
SFEOS
|
|
118
|
+
SFEOS provides enhanced collection search capabilities through two primary routes:
|
|
119
|
+
- **GET/POST `/collections`**: The standard STAC endpoint with extended query parameters
|
|
120
|
+
- **GET/POST `/collections-search`**: A custom endpoint that supports the same parameters, created to avoid conflicts with the STAC Transactions extension if enabled (which uses POST `/collections` for collection creation)
|
|
121
|
+
|
|
122
|
+
These endpoints support advanced collection discovery features including:
|
|
119
123
|
|
|
120
124
|
- **Sorting**: Sort collections by sortable fields using the `sortby` parameter
|
|
121
125
|
- Example: `/collections?sortby=+id` (ascending sort by ID)
|
|
@@ -131,9 +135,26 @@ SFEOS implements extended capabilities for the `/collections` endpoint, allowing
|
|
|
131
135
|
- Searches across multiple text fields including title, description, and keywords
|
|
132
136
|
- Supports partial word matching and relevance-based sorting
|
|
133
137
|
|
|
138
|
+
- **Structured Filtering**: Filter collections using CQL2 expressions
|
|
139
|
+
- JSON format: `/collections?filter={"op":"=","args":[{"property":"id"},"sentinel-2"]}&filter-lang=cql2-json`
|
|
140
|
+
- Text format: `/collections?filter=id='sentinel-2'&filter-lang=cql2-text` (note: string values must be quoted)
|
|
141
|
+
- Advanced text format: `/collections?filter=id LIKE '%sentinel%'&filter-lang=cql2-text` (supports LIKE, BETWEEN, etc.)
|
|
142
|
+
- Supports both CQL2 JSON and CQL2 text formats with various operators
|
|
143
|
+
- Enables precise filtering on any collection property
|
|
144
|
+
|
|
145
|
+
- **Datetime Filtering**: Filter collections by their temporal extent using the `datetime` parameter
|
|
146
|
+
- Example: `/collections?datetime=2020-01-01T00:00:00Z/2020-12-31T23:59:59Z` (finds collections with temporal extents that overlap this range)
|
|
147
|
+
- Example: `/collections?datetime=2020-06-15T12:00:00Z` (finds collections whose temporal extent includes this specific time)
|
|
148
|
+
- Example: `/collections?datetime=2020-01-01T00:00:00Z/..` (finds collections with temporal extents that extend to or beyond January 1, 2020)
|
|
149
|
+
- Example: `/collections?datetime=../2020-12-31T23:59:59Z` (finds collections with temporal extents that begin on or before December 31, 2020)
|
|
150
|
+
- Collections are matched if their temporal extent overlaps with the provided datetime parameter
|
|
151
|
+
- This allows for efficient discovery of collections based on time periods
|
|
152
|
+
|
|
134
153
|
These extensions make it easier to build user interfaces that display and navigate through collections efficiently.
|
|
135
154
|
|
|
136
|
-
> **Configuration**: Collection search extensions can be disabled by setting the `ENABLE_COLLECTIONS_SEARCH` environment variable to `false`. By default, these extensions are enabled.
|
|
155
|
+
> **Configuration**: Collection search extensions (sorting, field selection, free text search, structured filtering, and datetime filtering) for the `/collections` endpoint can be disabled by setting the `ENABLE_COLLECTIONS_SEARCH` environment variable to `false`. By default, these extensions are enabled.
|
|
156
|
+
>
|
|
157
|
+
> **Configuration**: The custom `/collections-search` endpoint can be enabled by setting the `ENABLE_COLLECTIONS_SEARCH_ROUTE` environment variable to `true`. By default, this endpoint is **disabled**.
|
|
137
158
|
|
|
138
159
|
> **Note**: Sorting is only available on fields that are indexed for sorting in Elasticsearch/OpenSearch. With the default mappings, you can sort on:
|
|
139
160
|
> - `id` (keyword field)
|
|
@@ -144,6 +165,7 @@ These extensions make it easier to build user interfaces that display and naviga
|
|
|
144
165
|
>
|
|
145
166
|
> **Important**: Adding keyword fields to make text fields sortable can significantly increase the index size, especially for large text fields. Consider the storage implications when deciding which fields to make sortable.
|
|
146
167
|
|
|
168
|
+
|
|
147
169
|
## Package Structure
|
|
148
170
|
|
|
149
171
|
This project is organized into several packages, each with a specific purpose:
|
|
@@ -156,7 +178,7 @@ This project is organized into several packages, each with a specific purpose:
|
|
|
156
178
|
- Shared logic and utilities that improve code reuse between backends
|
|
157
179
|
|
|
158
180
|
- **stac_fastapi_elasticsearch**: Complete implementation of the STAC API using Elasticsearch as the backend database. This package depends on both `stac_fastapi_core` and `sfeos_helpers`.
|
|
159
|
-
|
|
181
|
+
|
|
160
182
|
- **stac_fastapi_opensearch**: Complete implementation of the STAC API using OpenSearch as the backend database. This package depends on both `stac_fastapi_core` and `sfeos_helpers`.
|
|
161
183
|
|
|
162
184
|
## Examples
|
|
@@ -274,12 +296,13 @@ You can customize additional settings in your `.env` file:
|
|
|
274
296
|
| `ENABLE_DIRECT_RESPONSE` | Enable direct response for maximum performance (disables all FastAPI dependencies, including authentication, custom status codes, and validation) | `false` | Optional |
|
|
275
297
|
| `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 |
|
|
276
298
|
| `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 |
|
|
277
|
-
| `ENABLE_COLLECTIONS_SEARCH` | Enable collection search extensions (sort, fields).
|
|
278
|
-
| `
|
|
299
|
+
| `ENABLE_COLLECTIONS_SEARCH` | Enable collection search extensions (sort, fields, free text search, structured filtering, and datetime filtering) on the core `/collections` endpoint. | `true` | Optional |
|
|
300
|
+
| `ENABLE_COLLECTIONS_SEARCH_ROUTE` | Enable the custom `/collections-search` endpoint (both GET and POST methods). When disabled, the custom endpoint will not be available, but collection search extensions will still be available on the core `/collections` endpoint if `ENABLE_COLLECTIONS_SEARCH` is true. | `false` | Optional |
|
|
301
|
+
| `ENABLE_TRANSACTIONS_EXTENSIONS` | Enables or disables the Transactions and Bulk Transactions API extensions. This is useful for deployments where mutating the catalog via the API should be prevented. If set to `true`, the POST `/collections` route for search will be unavailable in the API. | `true` | Optional |
|
|
279
302
|
| `STAC_ITEM_LIMIT` | Sets the environment variable for result limiting to SFEOS for the number of returned items and STAC collections. | `10` | Optional |
|
|
280
303
|
| `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 |
|
|
281
304
|
| `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 |
|
|
282
|
-
| `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. |
|
|
305
|
+
| `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 |
|
|
283
306
|
|
|
284
307
|
> [!NOTE]
|
|
285
308
|
> 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.
|
|
@@ -425,7 +448,6 @@ The system uses a precise naming convention:
|
|
|
425
448
|
- `ENABLE_COLLECTIONS_SEARCH`: Set to `true` (default) to enable collection search extensions (sort, fields). Set to `false` to disable.
|
|
426
449
|
- `ENABLE_TRANSACTIONS_EXTENSIONS`: Set to `true` (default) to enable transaction extensions. Set to `false` to disable.
|
|
427
450
|
|
|
428
|
-
|
|
429
451
|
## Collection Pagination
|
|
430
452
|
|
|
431
453
|
- **Overview**: The collections route supports pagination through optional query parameters.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sfeos-helpers
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.5.0
|
|
4
4
|
Summary: Helper library for the Elasticsearch and Opensearch stac-fastapi backends.
|
|
5
5
|
Home-page: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch
|
|
6
6
|
License: MIT
|
|
@@ -84,13 +84,13 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
|
|
|
84
84
|
## Table of Contents
|
|
85
85
|
|
|
86
86
|
- [stac-fastapi-elasticsearch-opensearch](#stac-fastapi-elasticsearch-opensearch)
|
|
87
|
-
- [Sponsors
|
|
87
|
+
- [Sponsors & Supporters](#sponsors--supporters)
|
|
88
88
|
- [Project Introduction - What is SFEOS?](#project-introduction---what-is-sfeos)
|
|
89
89
|
- [Common Deployment Patterns](#common-deployment-patterns)
|
|
90
90
|
- [Technologies](#technologies)
|
|
91
91
|
- [Table of Contents](#table-of-contents)
|
|
92
92
|
- [Collection Search Extensions](#collection-search-extensions)
|
|
93
|
-
- [Documentation
|
|
93
|
+
- [Documentation & Resources](#documentation--resources)
|
|
94
94
|
- [Package Structure](#package-structure)
|
|
95
95
|
- [Examples](#examples)
|
|
96
96
|
- [Performance](#performance)
|
|
@@ -133,7 +133,11 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
|
|
|
133
133
|
|
|
134
134
|
## Collection Search Extensions
|
|
135
135
|
|
|
136
|
-
SFEOS
|
|
136
|
+
SFEOS provides enhanced collection search capabilities through two primary routes:
|
|
137
|
+
- **GET/POST `/collections`**: The standard STAC endpoint with extended query parameters
|
|
138
|
+
- **GET/POST `/collections-search`**: A custom endpoint that supports the same parameters, created to avoid conflicts with the STAC Transactions extension if enabled (which uses POST `/collections` for collection creation)
|
|
139
|
+
|
|
140
|
+
These endpoints support advanced collection discovery features including:
|
|
137
141
|
|
|
138
142
|
- **Sorting**: Sort collections by sortable fields using the `sortby` parameter
|
|
139
143
|
- Example: `/collections?sortby=+id` (ascending sort by ID)
|
|
@@ -149,9 +153,26 @@ SFEOS implements extended capabilities for the `/collections` endpoint, allowing
|
|
|
149
153
|
- Searches across multiple text fields including title, description, and keywords
|
|
150
154
|
- Supports partial word matching and relevance-based sorting
|
|
151
155
|
|
|
156
|
+
- **Structured Filtering**: Filter collections using CQL2 expressions
|
|
157
|
+
- JSON format: `/collections?filter={"op":"=","args":[{"property":"id"},"sentinel-2"]}&filter-lang=cql2-json`
|
|
158
|
+
- Text format: `/collections?filter=id='sentinel-2'&filter-lang=cql2-text` (note: string values must be quoted)
|
|
159
|
+
- Advanced text format: `/collections?filter=id LIKE '%sentinel%'&filter-lang=cql2-text` (supports LIKE, BETWEEN, etc.)
|
|
160
|
+
- Supports both CQL2 JSON and CQL2 text formats with various operators
|
|
161
|
+
- Enables precise filtering on any collection property
|
|
162
|
+
|
|
163
|
+
- **Datetime Filtering**: Filter collections by their temporal extent using the `datetime` parameter
|
|
164
|
+
- Example: `/collections?datetime=2020-01-01T00:00:00Z/2020-12-31T23:59:59Z` (finds collections with temporal extents that overlap this range)
|
|
165
|
+
- Example: `/collections?datetime=2020-06-15T12:00:00Z` (finds collections whose temporal extent includes this specific time)
|
|
166
|
+
- Example: `/collections?datetime=2020-01-01T00:00:00Z/..` (finds collections with temporal extents that extend to or beyond January 1, 2020)
|
|
167
|
+
- Example: `/collections?datetime=../2020-12-31T23:59:59Z` (finds collections with temporal extents that begin on or before December 31, 2020)
|
|
168
|
+
- Collections are matched if their temporal extent overlaps with the provided datetime parameter
|
|
169
|
+
- This allows for efficient discovery of collections based on time periods
|
|
170
|
+
|
|
152
171
|
These extensions make it easier to build user interfaces that display and navigate through collections efficiently.
|
|
153
172
|
|
|
154
|
-
> **Configuration**: Collection search extensions can be disabled by setting the `ENABLE_COLLECTIONS_SEARCH` environment variable to `false`. By default, these extensions are enabled.
|
|
173
|
+
> **Configuration**: Collection search extensions (sorting, field selection, free text search, structured filtering, and datetime filtering) for the `/collections` endpoint can be disabled by setting the `ENABLE_COLLECTIONS_SEARCH` environment variable to `false`. By default, these extensions are enabled.
|
|
174
|
+
>
|
|
175
|
+
> **Configuration**: The custom `/collections-search` endpoint can be enabled by setting the `ENABLE_COLLECTIONS_SEARCH_ROUTE` environment variable to `true`. By default, this endpoint is **disabled**.
|
|
155
176
|
|
|
156
177
|
> **Note**: Sorting is only available on fields that are indexed for sorting in Elasticsearch/OpenSearch. With the default mappings, you can sort on:
|
|
157
178
|
> - `id` (keyword field)
|
|
@@ -162,6 +183,7 @@ These extensions make it easier to build user interfaces that display and naviga
|
|
|
162
183
|
>
|
|
163
184
|
> **Important**: Adding keyword fields to make text fields sortable can significantly increase the index size, especially for large text fields. Consider the storage implications when deciding which fields to make sortable.
|
|
164
185
|
|
|
186
|
+
|
|
165
187
|
## Package Structure
|
|
166
188
|
|
|
167
189
|
This project is organized into several packages, each with a specific purpose:
|
|
@@ -174,7 +196,7 @@ This project is organized into several packages, each with a specific purpose:
|
|
|
174
196
|
- Shared logic and utilities that improve code reuse between backends
|
|
175
197
|
|
|
176
198
|
- **stac_fastapi_elasticsearch**: Complete implementation of the STAC API using Elasticsearch as the backend database. This package depends on both `stac_fastapi_core` and `sfeos_helpers`.
|
|
177
|
-
|
|
199
|
+
|
|
178
200
|
- **stac_fastapi_opensearch**: Complete implementation of the STAC API using OpenSearch as the backend database. This package depends on both `stac_fastapi_core` and `sfeos_helpers`.
|
|
179
201
|
|
|
180
202
|
## Examples
|
|
@@ -292,12 +314,13 @@ You can customize additional settings in your `.env` file:
|
|
|
292
314
|
| `ENABLE_DIRECT_RESPONSE` | Enable direct response for maximum performance (disables all FastAPI dependencies, including authentication, custom status codes, and validation) | `false` | Optional |
|
|
293
315
|
| `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 |
|
|
294
316
|
| `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 |
|
|
295
|
-
| `ENABLE_COLLECTIONS_SEARCH` | Enable collection search extensions (sort, fields).
|
|
296
|
-
| `
|
|
317
|
+
| `ENABLE_COLLECTIONS_SEARCH` | Enable collection search extensions (sort, fields, free text search, structured filtering, and datetime filtering) on the core `/collections` endpoint. | `true` | Optional |
|
|
318
|
+
| `ENABLE_COLLECTIONS_SEARCH_ROUTE` | Enable the custom `/collections-search` endpoint (both GET and POST methods). When disabled, the custom endpoint will not be available, but collection search extensions will still be available on the core `/collections` endpoint if `ENABLE_COLLECTIONS_SEARCH` is true. | `false` | Optional |
|
|
319
|
+
| `ENABLE_TRANSACTIONS_EXTENSIONS` | Enables or disables the Transactions and Bulk Transactions API extensions. This is useful for deployments where mutating the catalog via the API should be prevented. If set to `true`, the POST `/collections` route for search will be unavailable in the API. | `true` | Optional |
|
|
297
320
|
| `STAC_ITEM_LIMIT` | Sets the environment variable for result limiting to SFEOS for the number of returned items and STAC collections. | `10` | Optional |
|
|
298
321
|
| `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 |
|
|
299
322
|
| `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 |
|
|
300
|
-
| `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. |
|
|
323
|
+
| `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 |
|
|
301
324
|
|
|
302
325
|
> [!NOTE]
|
|
303
326
|
> 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.
|
|
@@ -443,7 +466,6 @@ The system uses a precise naming convention:
|
|
|
443
466
|
- `ENABLE_COLLECTIONS_SEARCH`: Set to `true` (default) to enable collection search extensions (sort, fields). Set to `false` to disable.
|
|
444
467
|
- `ENABLE_TRANSACTIONS_EXTENSIONS`: Set to `true` (default) to enable transaction extensions. Set to `false` to disable.
|
|
445
468
|
|
|
446
|
-
|
|
447
469
|
## Collection Pagination
|
|
448
470
|
|
|
449
471
|
- **Overview**: The collections route supports pagination through optional query parameters.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
stac-fastapi.core==6.5.0
|
|
@@ -72,7 +72,9 @@ class EsAsyncBaseFiltersClient(AsyncBaseFiltersClient):
|
|
|
72
72
|
field_properties = field_def.get("properties")
|
|
73
73
|
if field_properties:
|
|
74
74
|
stack.extend(
|
|
75
|
-
(f"{field_fqn}.{k}", v)
|
|
75
|
+
(f"{field_fqn}.{k}", v)
|
|
76
|
+
for k, v in field_properties.items()
|
|
77
|
+
if v.get("enabled", True)
|
|
76
78
|
)
|
|
77
79
|
|
|
78
80
|
# Skip non-indexed or disabled fields
|
|
@@ -161,7 +161,10 @@ ES_COLLECTIONS_MAPPINGS = {
|
|
|
161
161
|
"properties": {
|
|
162
162
|
"id": {"type": "keyword"},
|
|
163
163
|
"extent.spatial.bbox": {"type": "long"},
|
|
164
|
-
"extent.temporal.interval": {
|
|
164
|
+
"extent.temporal.interval": {
|
|
165
|
+
"type": "date",
|
|
166
|
+
"format": "strict_date_optional_time||epoch_millis",
|
|
167
|
+
},
|
|
165
168
|
"providers": {"type": "object", "enabled": False},
|
|
166
169
|
"links": {"type": "object", "enabled": False},
|
|
167
170
|
"item_assets": {"type": "object", "enabled": get_bool_env("STAC_INDEX_ASSETS")},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""library version."""
|
|
2
|
-
__version__ = "6.
|
|
2
|
+
__version__ = "6.5.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
stac-fastapi.core==6.4.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/aggregation/__init__.py
RENAMED
|
File without changes
|
{sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/aggregation/client.py
RENAMED
|
File without changes
|
{sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/aggregation/format.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/__init__.py
RENAMED
|
File without changes
|
{sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/base.py
RENAMED
|
File without changes
|
{sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/factory.py
RENAMED
|
File without changes
|
|
File without changes
|
{sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/inserters.py
RENAMED
|
File without changes
|
{sfeos_helpers-6.4.0 → sfeos_helpers-6.5.0}/stac_fastapi/sfeos_helpers/search_engine/managers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|