Skip to content

Commit dd6935e

Browse files
authored
Merge pull request #128 from ahuarte47/main_indexnames_variables
ES index names configurables
2 parents 133fc72 + 727ab97 commit dd6935e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
### Added
9+
10+
- The default Collection objects index can be overridden by the `STAC_COLLECTIONS_INDEX` environment variable.
11+
- The default Item objects index prefix can be overridden by the `STAC_ITEMS_INDEX_PREFIX` environment variable.
12+
813
## [v0.2.0]
914

1015
### Deprecated
1116

1217
### Added
1318

14-
- Filter Extension as GET with CQL2-Text and POST with CQL2-JSON,
19+
- Filter Extension as GET with CQL2-Text and POST with CQL2-JSON,
1520
supporting the Basic CQL2 and Basic Spatial Operators conformance classes.
1621
- Added Elasticsearch local config to support snapshot/restore to local filesystem
1722

@@ -44,7 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
4449
- Elasticsearch index mappings updated to be more thorough.
4550
- Endpoints that return items (e.g., /search) now sort the results by 'properties.datetime,id,collection'.
4651
Previously, there was no sort order defined.
47-
- Db_to_stac serializer moved to core.py for consistency as it existed in both core and database_logic previously.
52+
- Db_to_stac serializer moved to core.py for consistency as it existed in both core and database_logic previously.
4853
- Use genexp in execute_search and get_all_collections to return results.
4954
- Added db_to_stac serializer to item_collection method in core.py.
5055

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Database logic."""
22
import asyncio
33
import logging
4+
import os
45
from base64 import urlsafe_b64decode, urlsafe_b64encode
56
from typing import Any, Dict, Iterable, List, Optional, Protocol, Tuple, Type, Union
67

@@ -21,8 +22,8 @@
2122

2223
NumType = Union[float, int]
2324

24-
COLLECTIONS_INDEX = "collections"
25-
ITEMS_INDEX_PREFIX = "items_"
25+
COLLECTIONS_INDEX = os.getenv("STAC_COLLECTIONS_INDEX", "collections")
26+
ITEMS_INDEX_PREFIX = os.getenv("STAC_ITEMS_INDEX_PREFIX", "items_")
2627

2728
DEFAULT_INDICES = f"*,-*kibana*,-{COLLECTIONS_INDEX}"
2829

0 commit comments

Comments
 (0)