stac-fastapi-opensearch 6.5.1__tar.gz → 6.6.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.
- stac_fastapi_opensearch-6.6.0/.gitignore +143 -0
- stac_fastapi_opensearch-6.6.0/PKG-INFO +59 -0
- stac_fastapi_opensearch-6.6.0/README.md +20 -0
- stac_fastapi_opensearch-6.6.0/pyproject.toml +72 -0
- stac_fastapi_opensearch-6.6.0/pytest.ini +4 -0
- {stac_fastapi_opensearch-6.5.1 → stac_fastapi_opensearch-6.6.0}/stac_fastapi/opensearch/database_logic.py +29 -50
- {stac_fastapi_opensearch-6.5.1 → stac_fastapi_opensearch-6.6.0}/stac_fastapi/opensearch/version.py +1 -1
- stac_fastapi_opensearch-6.5.1/PKG-INFO +0 -716
- stac_fastapi_opensearch-6.5.1/README.md +0 -695
- stac_fastapi_opensearch-6.5.1/setup.cfg +0 -7
- stac_fastapi_opensearch-6.5.1/setup.py +0 -56
- stac_fastapi_opensearch-6.5.1/stac_fastapi_opensearch.egg-info/PKG-INFO +0 -716
- stac_fastapi_opensearch-6.5.1/stac_fastapi_opensearch.egg-info/SOURCES.txt +0 -15
- stac_fastapi_opensearch-6.5.1/stac_fastapi_opensearch.egg-info/dependency_links.txt +0 -1
- stac_fastapi_opensearch-6.5.1/stac_fastapi_opensearch.egg-info/entry_points.txt +0 -2
- stac_fastapi_opensearch-6.5.1/stac_fastapi_opensearch.egg-info/not-zip-safe +0 -1
- stac_fastapi_opensearch-6.5.1/stac_fastapi_opensearch.egg-info/requires.txt +0 -22
- stac_fastapi_opensearch-6.5.1/stac_fastapi_opensearch.egg-info/top_level.txt +0 -1
- {stac_fastapi_opensearch-6.5.1 → stac_fastapi_opensearch-6.6.0}/stac_fastapi/opensearch/__init__.py +0 -0
- {stac_fastapi_opensearch-6.5.1 → stac_fastapi_opensearch-6.6.0}/stac_fastapi/opensearch/app.py +0 -0
- {stac_fastapi_opensearch-6.5.1 → stac_fastapi_opensearch-6.6.0}/stac_fastapi/opensearch/config.py +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
elasticsearch/snapshots/
|
|
2
|
+
|
|
3
|
+
# Byte-compiled / optimized / DLL files
|
|
4
|
+
__pycache__/
|
|
5
|
+
*.py[cod]
|
|
6
|
+
*$py.class
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib/
|
|
20
|
+
lib64/
|
|
21
|
+
parts/
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
pip-wheel-metadata/
|
|
26
|
+
share/python-wheels/
|
|
27
|
+
*.egg-info/
|
|
28
|
+
.installed.cfg
|
|
29
|
+
*.egg
|
|
30
|
+
MANIFEST
|
|
31
|
+
|
|
32
|
+
# PyInstaller
|
|
33
|
+
# Usually these files are written by a python script from a template
|
|
34
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
35
|
+
*.manifest
|
|
36
|
+
*.spec
|
|
37
|
+
|
|
38
|
+
# Installer logs
|
|
39
|
+
pip-log.txt
|
|
40
|
+
pip-delete-this-directory.txt
|
|
41
|
+
|
|
42
|
+
# Unit test / coverage reports
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.nox/
|
|
46
|
+
.coverage
|
|
47
|
+
.coverage.*
|
|
48
|
+
.cache
|
|
49
|
+
nosetests.xml
|
|
50
|
+
coverage.xml
|
|
51
|
+
*.cover
|
|
52
|
+
*.py,cover
|
|
53
|
+
.hypothesis/
|
|
54
|
+
.pytest_cache/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
.python-version
|
|
88
|
+
|
|
89
|
+
# pipenv
|
|
90
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
91
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
92
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
93
|
+
# install all needed dependencies.
|
|
94
|
+
#Pipfile.lock
|
|
95
|
+
|
|
96
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
97
|
+
__pypackages__/
|
|
98
|
+
|
|
99
|
+
# Celery stuff
|
|
100
|
+
celerybeat-schedule
|
|
101
|
+
celerybeat.pid
|
|
102
|
+
|
|
103
|
+
# SageMath parsed files
|
|
104
|
+
*.sage.py
|
|
105
|
+
|
|
106
|
+
# Environments
|
|
107
|
+
.env
|
|
108
|
+
.venv
|
|
109
|
+
env/
|
|
110
|
+
venv/
|
|
111
|
+
ENV/
|
|
112
|
+
env.bak/
|
|
113
|
+
venv.bak/
|
|
114
|
+
|
|
115
|
+
# Spyder project settings
|
|
116
|
+
.spyderproject
|
|
117
|
+
.spyproject
|
|
118
|
+
|
|
119
|
+
# Rope project settings
|
|
120
|
+
.ropeproject
|
|
121
|
+
|
|
122
|
+
# mkdocs documentation
|
|
123
|
+
/site
|
|
124
|
+
|
|
125
|
+
# mypy
|
|
126
|
+
.mypy_cache/
|
|
127
|
+
.dmypy.json
|
|
128
|
+
dmypy.json
|
|
129
|
+
|
|
130
|
+
# Pyre type checker
|
|
131
|
+
.pyre/
|
|
132
|
+
|
|
133
|
+
/esdata
|
|
134
|
+
|
|
135
|
+
# Virtualenv
|
|
136
|
+
venv
|
|
137
|
+
|
|
138
|
+
# VSCode folder
|
|
139
|
+
.vscode
|
|
140
|
+
|
|
141
|
+
/docs/src/api/*
|
|
142
|
+
|
|
143
|
+
.DS_Store
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stac_fastapi_opensearch
|
|
3
|
+
Version: 6.6.0
|
|
4
|
+
Summary: An implementation of STAC API based on the FastAPI framework with Opensearch.
|
|
5
|
+
Project-URL: Homepage, https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: FastAPI,Opensearch,STAC,STAC-API,stac-fastapi
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: Intended Audience :: Information Technology
|
|
10
|
+
Classifier: Intended Audience :: Science/Research
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
|
+
Requires-Dist: opensearch-py[async]~=2.8.0
|
|
20
|
+
Requires-Dist: opensearch-py~=2.8.0
|
|
21
|
+
Requires-Dist: sfeos-helpers==6.6.0
|
|
22
|
+
Requires-Dist: stac-fastapi-core==6.6.0
|
|
23
|
+
Requires-Dist: starlette<0.36.0,>=0.35.0
|
|
24
|
+
Requires-Dist: uvicorn~=0.23.0
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: ciso8601~=2.3.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: httpx<0.28.0,>=0.24.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pre-commit~=3.0.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest-asyncio~=0.21.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-cov~=4.0.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest~=8.0; extra == 'dev'
|
|
32
|
+
Provides-Extra: docs
|
|
33
|
+
Requires-Dist: mkdocs-material~=9.0.0; extra == 'docs'
|
|
34
|
+
Requires-Dist: mkdocs~=1.4.0; extra == 'docs'
|
|
35
|
+
Requires-Dist: pdocs~=1.2.0; extra == 'docs'
|
|
36
|
+
Provides-Extra: server
|
|
37
|
+
Requires-Dist: uvicorn[standard]~=0.23.0; extra == 'server'
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# stac-fastapi-opensearch
|
|
41
|
+
|
|
42
|
+
This is the OpenSearch backend for stac-fastapi. For full documentation, please see the [main README](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/blob/main/README.md).
|
|
43
|
+
|
|
44
|
+
## Package Information
|
|
45
|
+
|
|
46
|
+
- **Package name**: stac-fastapi-opensearch
|
|
47
|
+
- **Description**: An implementation of STAC API based on the FastAPI framework with OpenSearch.
|
|
48
|
+
- **Documentation**: [https://stac-utils.github.io/stac-fastapi-elasticsearch-opensearch/](https://stac-utils.github.io/stac-fastapi-elasticsearch-opensearch/)
|
|
49
|
+
- **Source**: [GitHub Repository](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/)
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install stac-fastapi-opensearch
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Quick Start
|
|
58
|
+
|
|
59
|
+
For detailed usage and examples, please refer to the [main documentation](https://stac-utils.github.io/stac-fastapi-elasticsearch-opensearch/).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# stac-fastapi-opensearch
|
|
2
|
+
|
|
3
|
+
This is the OpenSearch backend for stac-fastapi. For full documentation, please see the [main README](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/blob/main/README.md).
|
|
4
|
+
|
|
5
|
+
## Package Information
|
|
6
|
+
|
|
7
|
+
- **Package name**: stac-fastapi-opensearch
|
|
8
|
+
- **Description**: An implementation of STAC API based on the FastAPI framework with OpenSearch.
|
|
9
|
+
- **Documentation**: [https://stac-utils.github.io/stac-fastapi-elasticsearch-opensearch/](https://stac-utils.github.io/stac-fastapi-elasticsearch-opensearch/)
|
|
10
|
+
- **Source**: [GitHub Repository](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/)
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install stac-fastapi-opensearch
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
For detailed usage and examples, please refer to the [main documentation](https://stac-utils.github.io/stac-fastapi-elasticsearch-opensearch/).
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "stac_fastapi_opensearch"
|
|
7
|
+
description = "An implementation of STAC API based on the FastAPI framework with Opensearch."
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.9"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
authors = []
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Intended Audience :: Developers",
|
|
14
|
+
"Intended Audience :: Information Technology",
|
|
15
|
+
"Intended Audience :: Science/Research",
|
|
16
|
+
"Programming Language :: Python :: 3.9",
|
|
17
|
+
"Programming Language :: Python :: 3.10",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Programming Language :: Python :: 3.13",
|
|
21
|
+
"Programming Language :: Python :: 3.14",
|
|
22
|
+
"License :: OSI Approved :: MIT License",
|
|
23
|
+
]
|
|
24
|
+
keywords = [
|
|
25
|
+
"STAC",
|
|
26
|
+
"STAC-API",
|
|
27
|
+
"FastAPI",
|
|
28
|
+
"Opensearch",
|
|
29
|
+
"stac-fastapi",
|
|
30
|
+
]
|
|
31
|
+
dynamic = ["version"]
|
|
32
|
+
dependencies = [
|
|
33
|
+
"stac-fastapi-core==6.6.0",
|
|
34
|
+
"sfeos-helpers==6.6.0",
|
|
35
|
+
"opensearch-py~=2.8.0",
|
|
36
|
+
"opensearch-py[async]~=2.8.0",
|
|
37
|
+
"uvicorn~=0.23.0",
|
|
38
|
+
"starlette>=0.35.0,<0.36.0",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[project.urls]
|
|
42
|
+
Homepage = "https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch"
|
|
43
|
+
|
|
44
|
+
[project.optional-dependencies]
|
|
45
|
+
dev = [
|
|
46
|
+
"pytest~=8.0",
|
|
47
|
+
"pytest-cov~=4.0.0",
|
|
48
|
+
"pytest-asyncio~=0.21.0",
|
|
49
|
+
"pre-commit~=3.0.0",
|
|
50
|
+
"ciso8601~=2.3.0",
|
|
51
|
+
"httpx>=0.24.0,<0.28.0",
|
|
52
|
+
]
|
|
53
|
+
docs = [
|
|
54
|
+
"mkdocs~=1.4.0",
|
|
55
|
+
"mkdocs-material~=9.0.0",
|
|
56
|
+
"pdocs~=1.2.0",
|
|
57
|
+
]
|
|
58
|
+
server = [
|
|
59
|
+
"uvicorn[standard]~=0.23.0",
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
[project.scripts]
|
|
63
|
+
stac-fastapi-opensearch = "stac_fastapi.opensearch.app:run"
|
|
64
|
+
|
|
65
|
+
[tool.hatch.version]
|
|
66
|
+
path = "stac_fastapi/opensearch/version.py"
|
|
67
|
+
|
|
68
|
+
[tool.hatch.build.targets.sdist]
|
|
69
|
+
exclude = ["alembic", "tests", "scripts"]
|
|
70
|
+
|
|
71
|
+
[tool.hatch.build.targets.wheel]
|
|
72
|
+
only-include = ["stac_fastapi"]
|
|
@@ -17,7 +17,7 @@ from starlette.requests import Request
|
|
|
17
17
|
|
|
18
18
|
from stac_fastapi.core.base_database_logic import BaseDatabaseLogic
|
|
19
19
|
from stac_fastapi.core.serializers import CollectionSerializer, ItemSerializer
|
|
20
|
-
from stac_fastapi.core.utilities import bbox2polygon, get_bool_env
|
|
20
|
+
from stac_fastapi.core.utilities import MAX_LIMIT, bbox2polygon, get_bool_env
|
|
21
21
|
from stac_fastapi.extensions.core.transaction.request import (
|
|
22
22
|
PartialCollection,
|
|
23
23
|
PartialItem,
|
|
@@ -29,6 +29,9 @@ from stac_fastapi.opensearch.config import (
|
|
|
29
29
|
from stac_fastapi.opensearch.config import OpensearchSettings as SyncSearchSettings
|
|
30
30
|
from stac_fastapi.sfeos_helpers import filter as filter_module
|
|
31
31
|
from stac_fastapi.sfeos_helpers.database import (
|
|
32
|
+
add_bbox_shape_to_collection,
|
|
33
|
+
apply_collections_bbox_filter_shared,
|
|
34
|
+
apply_collections_datetime_filter_shared,
|
|
32
35
|
apply_free_text_filter_shared,
|
|
33
36
|
apply_intersects_filter_shared,
|
|
34
37
|
create_index_templates_shared,
|
|
@@ -159,6 +162,7 @@ class DatabaseLogic(BaseDatabaseLogic):
|
|
|
159
162
|
limit: int,
|
|
160
163
|
request: Request,
|
|
161
164
|
sort: Optional[List[Dict[str, Any]]] = None,
|
|
165
|
+
bbox: Optional[List[float]] = None,
|
|
162
166
|
q: Optional[List[str]] = None,
|
|
163
167
|
filter: Optional[Dict[str, Any]] = None,
|
|
164
168
|
query: Optional[Dict[str, Dict[str, Any]]] = None,
|
|
@@ -171,6 +175,7 @@ class DatabaseLogic(BaseDatabaseLogic):
|
|
|
171
175
|
limit (int): The number of results to return.
|
|
172
176
|
request (Request): The FastAPI request object.
|
|
173
177
|
sort (Optional[List[Dict[str, Any]]]): Optional sort parameter from the request.
|
|
178
|
+
bbox (Optional[List[float]]): Bounding box to filter collections by spatial extent.
|
|
174
179
|
q (Optional[List[str]]): Free text search terms.
|
|
175
180
|
query (Optional[Dict[str, Dict[str, Any]]]): Query extension parameters.
|
|
176
181
|
filter (Optional[Dict[str, Any]]): Structured query in CQL2 format.
|
|
@@ -298,12 +303,15 @@ class DatabaseLogic(BaseDatabaseLogic):
|
|
|
298
303
|
query_parts.append({"bool": {"must_not": {"match_all": {}}}})
|
|
299
304
|
raise
|
|
300
305
|
|
|
301
|
-
#
|
|
302
|
-
|
|
303
|
-
if
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
306
|
+
# Apply bbox filter if provided
|
|
307
|
+
bbox_filter = apply_collections_bbox_filter_shared(bbox)
|
|
308
|
+
if bbox_filter:
|
|
309
|
+
query_parts.append(bbox_filter)
|
|
310
|
+
|
|
311
|
+
# Apply datetime filter if provided
|
|
312
|
+
datetime_filter = apply_collections_datetime_filter_shared(datetime)
|
|
313
|
+
if datetime_filter:
|
|
314
|
+
query_parts.append(datetime_filter)
|
|
307
315
|
|
|
308
316
|
# Combine all query parts with AND logic
|
|
309
317
|
if query_parts:
|
|
@@ -313,12 +321,6 @@ class DatabaseLogic(BaseDatabaseLogic):
|
|
|
313
321
|
else {"bool": {"must": query_parts}}
|
|
314
322
|
)
|
|
315
323
|
|
|
316
|
-
# Create a copy of the body for count query (without pagination and sorting)
|
|
317
|
-
count_body = body.copy()
|
|
318
|
-
if "search_after" in count_body:
|
|
319
|
-
del count_body["search_after"]
|
|
320
|
-
count_body["size"] = 0
|
|
321
|
-
|
|
322
324
|
# Create async tasks for both search and count
|
|
323
325
|
search_task = asyncio.create_task(
|
|
324
326
|
self.client.search(
|
|
@@ -454,41 +456,6 @@ class DatabaseLogic(BaseDatabaseLogic):
|
|
|
454
456
|
search=search, free_text_queries=free_text_queries
|
|
455
457
|
)
|
|
456
458
|
|
|
457
|
-
@staticmethod
|
|
458
|
-
def _apply_collection_datetime_filter(
|
|
459
|
-
datetime_str: Optional[str],
|
|
460
|
-
) -> Optional[Dict[str, Any]]:
|
|
461
|
-
"""Create a temporal filter for collections based on their extent."""
|
|
462
|
-
if not datetime_str:
|
|
463
|
-
return None
|
|
464
|
-
|
|
465
|
-
# Parse the datetime string into start and end
|
|
466
|
-
if "/" in datetime_str:
|
|
467
|
-
start, end = datetime_str.split("/")
|
|
468
|
-
# Replace open-ended ranges with concrete dates
|
|
469
|
-
if start == "..":
|
|
470
|
-
# For open-ended start, use a very early date
|
|
471
|
-
start = "1800-01-01T00:00:00Z"
|
|
472
|
-
if end == "..":
|
|
473
|
-
# For open-ended end, use a far future date
|
|
474
|
-
end = "2999-12-31T23:59:59Z"
|
|
475
|
-
else:
|
|
476
|
-
# If it's just a single date, use it for both start and end
|
|
477
|
-
start = end = datetime_str
|
|
478
|
-
|
|
479
|
-
return {
|
|
480
|
-
"bool": {
|
|
481
|
-
"must": [
|
|
482
|
-
# Check if any date in the array is less than or equal to the query end date
|
|
483
|
-
# This will match if the collection's start date is before or equal to the query end date
|
|
484
|
-
{"range": {"extent.temporal.interval": {"lte": end}}},
|
|
485
|
-
# Check if any date in the array is greater than or equal to the query start date
|
|
486
|
-
# This will match if the collection's end date is after or equal to the query start date
|
|
487
|
-
{"range": {"extent.temporal.interval": {"gte": start}}},
|
|
488
|
-
]
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
|
|
492
459
|
@staticmethod
|
|
493
460
|
def apply_datetime_filter(
|
|
494
461
|
search: Search, datetime: Optional[str]
|
|
@@ -808,7 +775,7 @@ class DatabaseLogic(BaseDatabaseLogic):
|
|
|
808
775
|
|
|
809
776
|
search_body["sort"] = sort if sort else DEFAULT_SORT
|
|
810
777
|
|
|
811
|
-
max_result_window =
|
|
778
|
+
max_result_window = MAX_LIMIT
|
|
812
779
|
|
|
813
780
|
size_limit = min(limit + 1, max_result_window)
|
|
814
781
|
|
|
@@ -1356,7 +1323,7 @@ class DatabaseLogic(BaseDatabaseLogic):
|
|
|
1356
1323
|
ConflictError: If a Collection with the same id already exists in the database.
|
|
1357
1324
|
|
|
1358
1325
|
Notes:
|
|
1359
|
-
A new index is created for the items in the Collection
|
|
1326
|
+
A new index is created for the items in the Collection if the index insertion strategy requires it.
|
|
1360
1327
|
"""
|
|
1361
1328
|
collection_id = collection["id"]
|
|
1362
1329
|
|
|
@@ -1373,6 +1340,12 @@ class DatabaseLogic(BaseDatabaseLogic):
|
|
|
1373
1340
|
if await self.client.exists(index=COLLECTIONS_INDEX, id=collection_id):
|
|
1374
1341
|
raise ConflictError(f"Collection {collection_id} already exists")
|
|
1375
1342
|
|
|
1343
|
+
if get_bool_env("ENABLE_COLLECTIONS_SEARCH") or get_bool_env(
|
|
1344
|
+
"ENABLE_COLLECTIONS_SEARCH_ROUTE"
|
|
1345
|
+
):
|
|
1346
|
+
# Convert bbox to bbox_shape for geospatial queries (ES/OS specific)
|
|
1347
|
+
add_bbox_shape_to_collection(collection)
|
|
1348
|
+
|
|
1376
1349
|
await self.client.index(
|
|
1377
1350
|
index=COLLECTIONS_INDEX,
|
|
1378
1351
|
id=collection_id,
|
|
@@ -1464,6 +1437,12 @@ class DatabaseLogic(BaseDatabaseLogic):
|
|
|
1464
1437
|
await self.delete_collection(collection_id=collection_id, **kwargs)
|
|
1465
1438
|
|
|
1466
1439
|
else:
|
|
1440
|
+
if get_bool_env("ENABLE_COLLECTIONS_SEARCH") or get_bool_env(
|
|
1441
|
+
"ENABLE_COLLECTIONS_SEARCH_ROUTE"
|
|
1442
|
+
):
|
|
1443
|
+
# Convert bbox to bbox_shape for geospatial queries (ES/OS specific)
|
|
1444
|
+
add_bbox_shape_to_collection(collection)
|
|
1445
|
+
|
|
1467
1446
|
await self.client.index(
|
|
1468
1447
|
index=COLLECTIONS_INDEX,
|
|
1469
1448
|
id=collection_id,
|
{stac_fastapi_opensearch-6.5.1 → stac_fastapi_opensearch-6.6.0}/stac_fastapi/opensearch/version.py
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""library version."""
|
|
2
|
-
__version__ = "6.
|
|
2
|
+
__version__ = "6.6.0"
|