
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
github.com/stac-utils/stac-fastapi-elasticsearch-opensearch
Advanced tools
Jump to: Project Introduction | Quick Start | Table of Contents
The following organizations have contributed time and/or funding to support the development of this project:
previous_token pagination using Redis for efficient navigation. This feature allows users to navigate backwards through large result sets by storing pagination state in Redis. To use this feature, ensure Redis is configured (see Redis for navigation) and set REDIS_ENABLE=true in your environment.EXCLUDED_FROM_QUERYABLES environment variable was added to exclude fields from the queryables endpoint. See docs.sfeos-tools CLI is now available on PyPIreindex command to SFEOS-tools for zero-downtime index updates when changing mappings or settings. The new reindex command makes it easy to apply mapping changes, update index settings, or migrate to new index structures without any service interruption, ensuring high availability of your STAC API during maintenance operations.SFEOS (stac-fastapi-elasticsearch-opensearch) is a high-performance, scalable API implementation for serving SpatioTemporal Asset Catalog (STAC) data - an enhanced GeoJSON format designed specifically for geospatial assets like satellite imagery, aerial photography, and other Earth observation data. This project enables organizations to:
This implementation builds on the STAC-FastAPI framework, providing a production-ready solution specifically optimized for Elasticsearch and OpenSearch databases. It's ideal for organizations managing large geospatial data catalogs who need efficient discovery and access capabilities through standardized APIs.
stac-fastapi-elasticsearch-opensearch can be deployed in several ways depending on your needs:
The implementation is flexible and can scale from small local deployments to large production environments serving millions of geospatial assets.
This project is built on the following technologies: STAC, stac-fastapi, FastAPI, Elasticsearch, Python, OpenSearch
The SFEOS STAC viewer is a web-based application for examining and testing STAC APIs. It provides an interactive interface to explore geospatial data catalogs, visualize spatial extents, and test API endpoints.
The viewer is available at: https://healy-hyperspatial.github.io/sfeos-web/
Navigate to the URL above and connect to your SFEOS API instance by providing the base URL of your STAC API. This is done with the API SERVER button on the right side of the page.
You can also override the default STAC API URL by appending the stacApiUrl parameter to the application URL. For example:
https://healy-hyperspatial.github.io/sfeos-web?stacApiUrl=http://localhost:8080
Note: The parameter name stacApiUrl is case-sensitive. This allows you to connect to different STAC API servers without modifying the web app configuration.
SFEOS provides enhanced collection search capabilities through two primary routes:
/collections: The standard STAC endpoint with extended query parameters/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)These endpoints support advanced collection discovery features including:
Sorting: Sort collections by sortable fields using the sortby parameter
/collections?sortby=+id (ascending sort by ID)/collections?sortby=-id (descending sort by ID)/collections?sortby=-temporal (descending sort by temporal extent)Field Selection: Request only specific fields to be returned using the fields parameter
/collections?fields=id,title,descriptionFree Text Search: Search across collection text fields using the q parameter
/collections?q=landsatStructured Filtering: Filter collections using CQL2 expressions
/collections?filter={"op":"=","args":[{"property":"id"},"sentinel-2"]}&filter-lang=cql2-json/collections?filter=id='sentinel-2'&filter-lang=cql2-text (note: string values must be quoted)/collections?filter=id LIKE '%sentinel%'&filter-lang=cql2-text (supports LIKE, BETWEEN, etc.)Datetime Filtering: Filter collections by their temporal extent using the datetime parameter
/collections?datetime=2020-01-01T00:00:00Z/2020-12-31T23:59:59Z (finds collections with temporal extents that overlap this range)/collections?datetime=2020-06-15T12:00:00Z (finds collections whose temporal extent includes this specific time)/collections?datetime=2020-01-01T00:00:00Z/.. (finds collections with temporal extents that extend to or beyond January 1, 2020)/collections?datetime=../2020-12-31T23:59:59Z (finds collections with temporal extents that begin on or before December 31, 2020)Spatial Filtering: Filter collections by their spatial extent using the bbox parameter
/collections?bbox=-10,35,40,70 (finds collections whose spatial extent intersects with this bounding box)/collections?bbox=-180,-90,180,90 (finds all collections with global coverage)[minx, miny, maxx, maxy] and 3D bounding boxes [minx, miny, minz, maxx, maxy, maxz] (altitude values are ignored for spatial queries)extent.spatial.bbox field) intersects with the provided bbox parameterbbox_shape field is automatically generated from the collection's spatial extent and indexed as a GeoJSON polygon for efficient geospatial queriesbbox_shape field added. You can either:
/collections/{collection_id} with the existing collection data)pip install sfeos-tools[elasticsearch] or pip install sfeos-tools[opensearch]):
sfeos-tools add-bbox-shape --backend elasticsearch --no-sslsfeos-tools add-bbox-shape --backend opensearch --host db.example.com --no-sslThese extensions make it easier to build user interfaces that display and navigate through collections efficiently.
Configuration: Collection search extensions (sorting, field selection, free text search, structured filtering, datetime filtering, and spatial filtering) for the
/collectionsendpoint can be disabled by setting theENABLE_COLLECTIONS_SEARCHenvironment variable tofalse. By default, these extensions are enabled.Configuration: The custom
/collections-searchendpoint can be enabled by setting theENABLE_COLLECTIONS_SEARCH_ROUTEenvironment variable totrue. By default, this endpoint is disabled.
Note: Sorting is only available on fields that are indexed for sorting in Elasticsearch/OpenSearch. With the default mappings, you can sort on:
id(keyword field)extent.temporal.interval(date field)temporal(alias to extent.temporal.interval)Text fields like
titleanddescriptionare not sortable by default as they use text analysis for better search capabilities. Attempting to sort on these fields will result in a user-friendly error message explaining which fields are sortable and how to make additional fields sortable by updating the mappings.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.
This project is organized into several packages, each with a specific purpose:
stac_fastapi_core: Core functionality that's database-agnostic, including API models, extensions, and shared utilities. This package provides the foundation for building STAC API implementations with any database backend. See stac-fastapi-mongo for a working example.
sfeos_helpers: Shared helper functions and utilities used by both the Elasticsearch and OpenSearch backends. This package includes:
database: Specialized modules for index, document, and database utility operationsaggregation: Elasticsearch/OpenSearch-specific aggregation functionalitystac_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.
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.
The /examples directory contains several useful examples and reference implementations:
These examples provide practical reference implementations for various deployment scenarios and features.
enable_direct_response option is provided by the stac-fastapi core library (introduced in stac-fastapi 5.2.0) and is available in this project starting from v4.0.0.ENABLE_DIRECT_RESPONSE=true to enable this feature.false for safety.This section helps you get up and running with stac-fastapi-elasticsearch-opensearch quickly.
For versions 4.0.0a1 and newer (PEP 625 compliant naming):
pip install stac-fastapi-elasticsearch # Elasticsearch backend
pip install stac-fastapi-opensearch # Opensearch backend
pip install stac-fastapi-core # Core library
For versions 4.0.0a0 and older:
pip install stac-fastapi.elasticsearch # Elasticsearch backend
pip install stac-fastapi.opensearch # Opensearch backend
pip install stac-fastapi.core # Core library
Important Note: Starting with version 4.0.0a1, package names have changed from using periods (e.g.,
stac-fastapi.core) to using hyphens (e.g.,stac-fastapi-core) to comply with PEP 625. The internal package structure uses underscores, but users should install with hyphens as shown above. Please update your requirements files accordingly.
There are two main ways to run the API locally:
We provide ready-to-use Docker images through GitHub Container Registry:
Pull and run the images:
# For Elasticsearch backend
docker pull ghcr.io/stac-utils/stac-fastapi-es:latest
# For OpenSearch backend
docker pull ghcr.io/stac-utils/stac-fastapi-os:latest
Prerequisites: Ensure Docker Compose or Podman Compose is installed on your machine.
Start the API:
docker compose up elasticsearch app-elasticsearch
Configuration: By default, Docker Compose uses Elasticsearch 8.x and OpenSearch 2.11.1. To use different versions, create a .env file:
ELASTICSEARCH_VERSION=8.11.0
OPENSEARCH_VERSION=2.11.1
ENABLE_DIRECT_RESPONSE=false
Compatibility: The most recent Elasticsearch 7.x versions should also work. See the opensearch-py docs for compatibility information.
You can customize additional settings in your .env file:
| Variable | Description | Default | Required |
|---|---|---|---|
ES_HOST | Hostname for external Elasticsearch/OpenSearch. | localhost | Optional |
ES_PORT | Port for Elasticsearch/OpenSearch. | 9200 (ES) / 9202 (OS) | Optional |
ES_USE_SSL | Use SSL for connecting to Elasticsearch/OpenSearch. | true | Optional |
ES_VERIFY_CERTS | Verify SSL certificates when connecting. | true | Optional |
ES_API_KEY | API Key for external Elasticsearch/OpenSearch. | N/A | Optional |
ES_TIMEOUT | Client timeout for Elasticsearch/OpenSearch. | DB client default | Optional |
STAC_FASTAPI_TITLE | Title of the API in the documentation. | stac-fastapi-<backend> | Optional |
STAC_FASTAPI_DESCRIPTION | Description of the API in the documentation. | N/A | Optional |
STAC_FASTAPI_VERSION | API version. | 2.1 | Optional |
STAC_FASTAPI_LANDING_PAGE_ID | Landing page ID | stac-fastapi | Optional |
APP_HOST | Server bind address. | 0.0.0.0 | Optional |
APP_PORT | Server port. | 8000 | Optional |
ENVIRONMENT | Runtime environment. | local | Optional |
WEB_CONCURRENCY | Number of worker processes. | 10 | Optional |
RELOAD | Enable auto-reload for development. | true | Optional |
STAC_FASTAPI_RATE_LIMIT | API rate limit per client. | 200/minute | Optional |
BACKEND | Tests-related variable | elasticsearch or opensearch based on the backend | Optional |
ELASTICSEARCH_VERSION | Version of Elasticsearch to use. | 8.11.0 | Optional |
OPENSEARCH_VERSION | OpenSearch version | 2.11.1 | Optional |
ENABLE_DIRECT_RESPONSE | Enable direct response for maximum performance (disables all FastAPI dependencies, including authentication, custom status codes, and validation) | false | Optional |
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 |
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) on the core /collections endpoint. | true | Optional |
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 |
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 |
STAC_GLOBAL_COLLECTION_MAX_LIMIT | Configures the maximum number of STAC collections that can be returned in a single search request. | N/A | Optional |
STAC_DEFAULT_COLLECTION_LIMIT | Configures the default number of STAC collections returned when no limit parameter is specified in the request. | 300 | Optional |
STAC_GLOBAL_ITEM_MAX_LIMIT | Configures the maximum number of STAC items that can be returned in a single search request. | N/A | Optional |
STAC_DEFAULT_ITEM_LIMIT | Configures the default number of STAC items returned when no limit parameter is specified in the request. | 10 | Optional |
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 |
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 |
USE_DATETIME_NANOS | Enables nanosecond precision handling for datetime field searches as per the date_nanos type. When False, it uses 3 millisecond precision as per the type date. | true | Optional |
EXCLUDED_FROM_QUERYABLES | Comma-separated list of fully qualified field names to exclude from the queryables endpoint and filtering. Use full paths like properties.auth:schemes,properties.storage:schemes. Excluded fields and their nested children will not be exposed in queryables. | None | Optional |
EXCLUDED_FROM_ITEMS | Specifies fields to exclude from STAC item responses. Supports comma-separated field names and dot notation for nested fields (e.g., private_data,properties.confidential,assets.internal). | None | Optional |
[!NOTE] The variables
ES_HOST,ES_PORT,ES_USE_SSL,ES_VERIFY_CERTSandES_TIMEOUTapply to both Elasticsearch and OpenSearch backends, so there is no need to rename the key names toOS_even if you're using OpenSearch.
These Redis configuration variables to enable proper navigation functionality in STAC FastAPI.
| Variable | Description | Default | Required |
|---|---|---|---|
REDIS_ENABLE | Enables or disables Redis caching for navigation. Set to true to use Redis, or false to disable. | false | Required (determines whether Redis is used at all) |
| Redis Sentinel | |||
REDIS_SENTINEL_HOSTS | Comma-separated list of Redis Sentinel hostnames/IP addresses. | "" | Conditional (required if using Sentinel) |
REDIS_SENTINEL_PORTS | Comma-separated list of Redis Sentinel ports (must match order). | "26379" | Conditional (required if using Sentinel) |
REDIS_SENTINEL_MASTER_NAME | Name of the Redis master node in Sentinel configuration. | "master" | Conditional (required if using Sentinel) |
| Redis | |||
REDIS_HOST | Redis server hostname or IP address for Redis configuration. | "" | Conditional (required for standalone Redis) |
REDIS_PORT | Redis server port for Redis configuration. | 6379 | Conditional (required for standalone Redis) |
| Both | |||
REDIS_DB | Redis database number to use for caching. | 0 (Sentinel) / 15 (Standalone) | Optional |
REDIS_MAX_CONNECTIONS | Maximum number of connections in the Redis connection pool. | 10 | Optional |
REDIS_RETRY_TIMEOUT | Enable retry on timeout for Redis operations. | true | Optional |
REDIS_DECODE_RESPONSES | Automatically decode Redis responses to strings. | true | Optional |
REDIS_CLIENT_NAME | Client name identifier for Redis connections. | "stac-fastapi-app" | Optional |
REDIS_HEALTH_CHECK_INTERVAL | Interval in seconds for Redis health checks. | 30 | Optional |
REDIS_SELF_LINK_TTL | Time-to-live (TTL) in seconds for storing self-links in Redis, used for pagination caching. | 1800 | Optional |
[!NOTE] Use either the Sentinel configuration (
REDIS_SENTINEL_HOSTS,REDIS_SENTINEL_PORTS,REDIS_SENTINEL_MASTER_NAME) OR the Redis configuration (REDIS_HOST,REDIS_PORT), but not both.
You can exclude specific fields from being exposed in the queryables endpoint and from filtering by setting the EXCLUDED_FROM_QUERYABLES environment variable. This is useful for hiding sensitive or internal fields that should not be queryable by API users.
Environment Variable:
EXCLUDED_FROM_QUERYABLES="properties.auth:schemes,properties.storage:schemes,properties.internal:metadata"
Format:
properties. prefix for item propertiesproperties.auth:schemesproperties.storage:schemesBehavior:
SFEOS supports two indexing strategies for managing STAC items:
The datetime-based indexing strategy is particularly useful for large temporal datasets. When a user provides a datetime parameter in a query, the system knows exactly which index to search, providing multiple times faster searches and significantly reducing database load.
Recommended for:
Pros:
Cons:
Enable datetime-based indexing by setting the following environment variable:
ENABLE_DATETIME_INDEX_FILTERING=true
| Variable | Description | Default | Example |
|---|---|---|---|
ENABLE_DATETIME_INDEX_FILTERING | Enables time-based index partitioning | false | true |
DATETIME_INDEX_MAX_SIZE_GB | Maximum size limit for datetime indexes (GB) - note: add +20% to target size due to ES/OS compression | 25 | 50 |
STAC_ITEMS_INDEX_PREFIX | Prefix for item indexes | items_ | stac_items_ |
The system uses a precise naming convention:
Physical indexes:
{ITEMS_INDEX_PREFIX}{collection-id}_{uuid4}
Aliases:
{ITEMS_INDEX_PREFIX}{collection-id} # Main collection alias
{ITEMS_INDEX_PREFIX}{collection-id}_{start-datetime} # Temporal alias
{ITEMS_INDEX_PREFIX}{collection-id}_{start-datetime}_{end-datetime} # Closed index alias
Example:
Physical indexes:
items_sentinel-2-l2a_a1b2c3d4-e5f6-7890-abcd-ef1234567890Aliases:
items_sentinel-2-l2a - main collection aliasitems_sentinel-2-l2a_2024-01-01 - active alias from January 1, 2024items_sentinel-2-l2a_2024-01-01_2024-03-15 - closed index alias (reached size limit)Important - Data Compression: Elasticsearch and OpenSearch automatically compress data. The configured DATETIME_INDEX_MAX_SIZE_GB limit refers to the compressed size on disk. It is recommended to add +20% to the target size to account for compression overhead and metadata.
Creating a Collection:
curl -X "POST" "http://localhost:8080/collections" \
-H 'Content-Type: application/json' \
-d $'{
"id": "my_collection"
}'
Adding an Item to a Collection:
curl -X "POST" "http://localhost:8080/collections/my_collection/items" \
-H 'Content-Type: application/json' \
-d @item.json
Searching for Items:
curl -X "GET" "http://localhost:8080/search" \
-H 'Content-Type: application/json' \
-d $'{
"collections": ["my_collection"],
"limit": 10
}'
Filtering by Bbox:
curl -X "GET" "http://localhost:8080/search" \
-H 'Content-Type: application/json' \
-d $'{
"collections": ["my_collection"],
"bbox": [-180, -90, 180, 90]
}'
Filtering by Datetime:
curl -X "GET" "http://localhost:8080/search" \
-H 'Content-Type: application/json' \
-d $'{
"collections": ["my_collection"],
"datetime": "2020-01-01T00:00:00Z/2020-12-31T23:59:59Z"
}'
API Title and Description: By default set to stac-fastapi-<backend>. Customize these by setting:
STAC_FASTAPI_TITLE: Changes the API title in the documentationSTAC_FASTAPI_DESCRIPTION: Changes the API description in the documentationDatabase Indices: By default, the API reads from and writes to:
collections index for collectionsitems_<collection name> indices for itemsSTAC_COLLECTIONS_INDEX and STAC_ITEMS_INDEX_PREFIX environment variablesRoot Path Configuration: The application root path is the base URL by default.
STAC_FASTAPI_ROOT_PATH to match the Gateway API stage name (e.g., /v1)Feature Configuration: Control which features are enabled:
ENABLE_COLLECTIONS_SEARCH: Set to true (default) to enable collection search extensions (sort, fields). Set to false to disable.ENABLE_TRANSACTIONS_EXTENSIONS: Set to true (default) to enable transaction extensions. Set to false to disable.limit: Controls the number of collections returned per pagetoken: Used to retrieve subsequent pages of resultslinks field in the response contains a next link with the token for the next page of results.curl -X "GET" "http://localhost:8080/collections?limit=1&token=example_token"
Overview: SFEOS Tools is an installable CLI package for managing and maintaining SFEOS deployments. This CLI package provides utilities for managing and maintaining SFEOS deployments.
Installation:
# For Elasticsearch (from PyPI)
pip install sfeos-tools[elasticsearch]
# For OpenSearch (from PyPI)
pip install sfeos-tools[opensearch]
Available Commands:
add-bbox-shape: Add bbox_shape field to existing collections for spatial search supportreindex: Reindex all STAC indices (collections and per-collection items) to new versioned indices and update aliases; supports both Elasticsearch and OpenSearch backends. Use this when you need to apply mapping changes, update index settings, or migrate to a new index structure. The command handles the entire process including creating new indices, reindexing data, and atomically updating aliases with zero downtime.Basic Usage:
sfeos-tools add-bbox-shape --backend elasticsearch
sfeos-tools add-bbox-shape --backend opensearch
Connection Options: Configure database connection via CLI flags or environment variables:
--host: Database host (default: localhost or ES_HOST env var)--port: Database port (default: 9200 or ES_PORT env var)--use-ssl / --no-ssl: Use SSL connection (default: true or ES_USE_SSL env var)--user: Database username (default: ES_USER env var)--password: Database password (default: ES_PASS env var)Examples:
# Local Docker Compose (no SSL)
sfeos-tools add-bbox-shape --backend elasticsearch --no-ssl
# Remote server with SSL
sfeos-tools add-bbox-shape \
--backend elasticsearch \
--host db.example.com \
--port 9200 \
--user admin \
--password secret
# Cloud deployment with environment variables
ES_HOST=my-es-cluster.cloud.com ES_PORT=9243 ES_USER=elastic ES_PASS=changeme \
sfeos-tools add-bbox-shape --backend elasticsearch
# Using --help for more information
sfeos-tools --help
sfeos-tools add-bbox-shape --help
sfeos-tools reindex --help
Documentation: For complete documentation, examples, and advanced usage, please visit the SFEOS Tools GitHub repository.
Contributing: Contributions, bug reports, and feature requests are welcome! Please file them on the SFEOS Tools issue tracker.
Overview: The data_loader.py script provides a convenient way to load STAC items into the database.
Usage:
python3 data_loader.py --base-url http://localhost:8080
Options:
--base-url TEXT Base URL of the STAC API [required]
--collection-id TEXT ID of the collection to which items are added
--use-bulk Use bulk insert method for items
--data-dir PATH Directory containing collection.json and feature
collection file
--help Show this message and exit.
Example Workflows:
python3 data_loader.py --base-url http://localhost:8080
python3 data_loader.py --base-url http://localhost:8080 --collection-id my-collection
python3 data_loader.py --base-url http://localhost:8080 --use-bulk
The Redis cache stores navigation state for paginated results, allowing the system to maintain previous page links using tokens. The configuration supports both Redis Sentinel and standalone Redis setups.
Steps to configure:
REDIS_ENABLE environment variable to True or False.Redis is installed:pip install stac-fastapi-elasticsearch[redis]
sfeos_helpers package contains shared mapping definitions used by both Elasticsearch and OpenSearch backendsOverview: Snapshots provide a way to backup and restore your indices.
Creating a Snapshot Repository:
curl -X "PUT" "http://localhost:9200/_snapshot/my_fs_backup" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"type": "fs",
"settings": {
"location": "/usr/share/elasticsearch/snapshots/my_fs_backup"
}
}'
Creating a Snapshot:
curl -X "PUT" "http://localhost:9200/_snapshot/my_fs_backup/my_snapshot_2?wait_for_completion=true" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"metadata": {
"taken_because": "dump of all items",
"taken_by": "pvarner"
},
"include_global_state": false,
"ignore_unavailable": false,
"indices": "items_my-collection"
}'
Viewing Snapshots:
# View a specific snapshot
curl http://localhost:9200/_snapshot/my_fs_backup/my_snapshot_2
# View all snapshots
curl http://localhost:9200/_snapshot/my_fs_backup/_all
Restoring a Snapshot:
curl -X "POST" "http://localhost:9200/_snapshot/my_fs_backup/my_snapshot_2/_restore?wait_for_completion=true" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"include_aliases": false,
"include_global_state": false,
"ignore_unavailable": true,
"rename_replacement": "items_$1-copy",
"indices": "items_*",
"rename_pattern": "items_(.+)"
}'
Updating Collection References:
curl -X "POST" "http://localhost:9200/items_my-collection-copy/_update_by_query" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"query": {
"match_all": {}
},
"script": {
"lang": "painless",
"params": {
"collection": "my-collection-copy"
},
"source": "ctx._source.collection = params.collection"
}
}'
Creating a New Collection:
curl -X "POST" "http://localhost:8080/collections" \
-H 'Content-Type: application/json' \
-d $'{
"id": "my-collection-copy"
}'
Overview: Reindexing allows you to copy documents from one index to another, optionally transforming them in the process.
Use Cases:
Example: Reindexing with Transformation:
curl -X "POST" "http://localhost:9200/_reindex" \
-H 'Content-Type: application/json' \
-d $'{
"source": {
"index": "items_my-collection-lower_my-collection-hex-000001"
},
"dest": {
"index": "items_my-collection-lower_my-collection-hex-000002"
},
"script": {
"source": "ctx._source.id = ctx._source.id.toLowerCase()",
"lang": "painless"
}
}'
Updating Aliases:
curl -X "POST" "http://localhost:9200/_aliases" \
-H 'Content-Type: application/json' \
-d $'{
"actions": [
{
"remove": {
"index": "*",
"alias": "items_my-collection"
}
},
{
"add": {
"index": "items_my-collection-lower_my-collection-hex-000002",
"alias": "items_my-collection"
}
}
]
}'
STAC_FASTAPI_ROUTE_DEPENDENCIES environment variable.Supported Aggregations:
Endpoint Locations:
/aggregations/<collection_id>/aggregationsImplementation Details: The sfeos_helpers.aggregation package provides specialized functionality for both Elasticsearch and OpenSearch backends.
Documentation: Detailed information about supported aggregations can be found in the aggregation docs.
Overview: Rate limiting is an optional security feature that controls API request frequency on a remote address basis.
Configuration: Enabled by setting the STAC_FASTAPI_RATE_LIMIT environment variable:
STAC_FASTAPI_RATE_LIMIT=500/minute
Functionality:
Examples: Implementation examples are available in the examples/rate_limit directory.
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.