stac-fastapi.core 3.2.2__tar.gz → 3.2.3__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.core-3.2.2 → stac_fastapi.core-3.2.3}/PKG-INFO +7 -7
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/README.md +6 -6
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/setup.py +1 -1
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/extensions/filter.py +22 -10
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/version.py +1 -1
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi.core.egg-info/PKG-INFO +7 -7
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi.core.egg-info/requires.txt +1 -1
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/setup.cfg +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/__init__.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/base_database_logic.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/base_settings.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/basic_auth.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/core.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/datetime_utils.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/extensions/__init__.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/extensions/aggregation.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/extensions/fields.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/extensions/query.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/models/__init__.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/models/links.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/models/search.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/rate_limit.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/route_dependencies.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/serializers.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/session.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/utilities.py +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi.core.egg-info/SOURCES.txt +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi.core.egg-info/dependency_links.txt +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi.core.egg-info/not-zip-safe +0 -0
- {stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi.core.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: stac_fastapi.core
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.3
|
|
4
4
|
Summary: Core 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
|
|
@@ -285,17 +285,17 @@ A reindex operation might be useful to apply changes to documents or to correct
|
|
|
285
285
|
|
|
286
286
|
The index templates will make sure that manually created indices will also have the correct mappings and settings.
|
|
287
287
|
|
|
288
|
-
In this example, we will make a copy of an existing Item index `items_my-collection-000001` but change the Item identifier to be lowercase.
|
|
288
|
+
In this example, we will make a copy of an existing Item index `items_my-collection-lower_my-collection-hex-000001` but change the Item identifier to be lowercase.
|
|
289
289
|
|
|
290
290
|
```shell
|
|
291
291
|
curl -X "POST" "http://localhost:9200/_reindex" \
|
|
292
292
|
-H 'Content-Type: application/json' \
|
|
293
293
|
-d $'{
|
|
294
294
|
"source": {
|
|
295
|
-
"index": "items_my-collection-000001"
|
|
295
|
+
"index": "items_my-collection-lower_my-collection-hex-000001"
|
|
296
296
|
},
|
|
297
297
|
"dest": {
|
|
298
|
-
"index": "items_my-collection-000002"
|
|
298
|
+
"index": "items_my-collection-lower_my-collection-hex-000002"
|
|
299
299
|
},
|
|
300
300
|
"script": {
|
|
301
301
|
"source": "ctx._source.id = ctx._source.id.toLowerCase()",
|
|
@@ -304,7 +304,7 @@ curl -X "POST" "http://localhost:9200/_reindex" \
|
|
|
304
304
|
}'
|
|
305
305
|
```
|
|
306
306
|
|
|
307
|
-
If we are happy with the data in the newly created index, we can move the alias `items_my-collection` to the new index `items_my-collection-000002`.
|
|
307
|
+
If we are happy with the data in the newly created index, we can move the alias `items_my-collection` to the new index `items_my-collection-lower_my-collection-hex-000002`.
|
|
308
308
|
```shell
|
|
309
309
|
curl -X "POST" "http://localhost:9200/_aliases" \
|
|
310
310
|
-h 'Content-Type: application/json' \
|
|
@@ -318,7 +318,7 @@ curl -X "POST" "http://localhost:9200/_aliases" \
|
|
|
318
318
|
},
|
|
319
319
|
{
|
|
320
320
|
"add": {
|
|
321
|
-
"index": "items_my-collection-000002",
|
|
321
|
+
"index": "items_my-collection-lower_my-collection-hex-000002",
|
|
322
322
|
"alias": "items_my-collection"
|
|
323
323
|
}
|
|
324
324
|
}
|
|
@@ -335,7 +335,7 @@ Authentication is an optional feature that can be enabled through `Route Depende
|
|
|
335
335
|
|
|
336
336
|
## Aggregation
|
|
337
337
|
|
|
338
|
-
Aggregation of points and geometries, as well as frequency distribution aggregation of any other property including dates is supported in stac-fatsapi-elasticsearch-opensearch. Aggregations can be defined at the root Catalog level (`/aggregations`) and at the Collection level (`/<collection_id>/aggregations`). Details for supported aggregations can be found
|
|
338
|
+
Aggregation of points and geometries, as well as frequency distribution aggregation of any other property including dates is supported in stac-fatsapi-elasticsearch-opensearch. Aggregations can be defined at the root Catalog level (`/aggregations`) and at the Collection level (`/<collection_id>/aggregations`). Details for supported aggregations can be found in [the aggregation docs](./docs/src/aggregation.md)
|
|
339
339
|
|
|
340
340
|
## Rate Limiting
|
|
341
341
|
|
|
@@ -267,17 +267,17 @@ A reindex operation might be useful to apply changes to documents or to correct
|
|
|
267
267
|
|
|
268
268
|
The index templates will make sure that manually created indices will also have the correct mappings and settings.
|
|
269
269
|
|
|
270
|
-
In this example, we will make a copy of an existing Item index `items_my-collection-000001` but change the Item identifier to be lowercase.
|
|
270
|
+
In this example, we will make a copy of an existing Item index `items_my-collection-lower_my-collection-hex-000001` but change the Item identifier to be lowercase.
|
|
271
271
|
|
|
272
272
|
```shell
|
|
273
273
|
curl -X "POST" "http://localhost:9200/_reindex" \
|
|
274
274
|
-H 'Content-Type: application/json' \
|
|
275
275
|
-d $'{
|
|
276
276
|
"source": {
|
|
277
|
-
"index": "items_my-collection-000001"
|
|
277
|
+
"index": "items_my-collection-lower_my-collection-hex-000001"
|
|
278
278
|
},
|
|
279
279
|
"dest": {
|
|
280
|
-
"index": "items_my-collection-000002"
|
|
280
|
+
"index": "items_my-collection-lower_my-collection-hex-000002"
|
|
281
281
|
},
|
|
282
282
|
"script": {
|
|
283
283
|
"source": "ctx._source.id = ctx._source.id.toLowerCase()",
|
|
@@ -286,7 +286,7 @@ curl -X "POST" "http://localhost:9200/_reindex" \
|
|
|
286
286
|
}'
|
|
287
287
|
```
|
|
288
288
|
|
|
289
|
-
If we are happy with the data in the newly created index, we can move the alias `items_my-collection` to the new index `items_my-collection-000002`.
|
|
289
|
+
If we are happy with the data in the newly created index, we can move the alias `items_my-collection` to the new index `items_my-collection-lower_my-collection-hex-000002`.
|
|
290
290
|
```shell
|
|
291
291
|
curl -X "POST" "http://localhost:9200/_aliases" \
|
|
292
292
|
-h 'Content-Type: application/json' \
|
|
@@ -300,7 +300,7 @@ curl -X "POST" "http://localhost:9200/_aliases" \
|
|
|
300
300
|
},
|
|
301
301
|
{
|
|
302
302
|
"add": {
|
|
303
|
-
"index": "items_my-collection-000002",
|
|
303
|
+
"index": "items_my-collection-lower_my-collection-hex-000002",
|
|
304
304
|
"alias": "items_my-collection"
|
|
305
305
|
}
|
|
306
306
|
}
|
|
@@ -317,7 +317,7 @@ Authentication is an optional feature that can be enabled through `Route Depende
|
|
|
317
317
|
|
|
318
318
|
## Aggregation
|
|
319
319
|
|
|
320
|
-
Aggregation of points and geometries, as well as frequency distribution aggregation of any other property including dates is supported in stac-fatsapi-elasticsearch-opensearch. Aggregations can be defined at the root Catalog level (`/aggregations`) and at the Collection level (`/<collection_id>/aggregations`). Details for supported aggregations can be found
|
|
320
|
+
Aggregation of points and geometries, as well as frequency distribution aggregation of any other property including dates is supported in stac-fatsapi-elasticsearch-opensearch. Aggregations can be defined at the root Catalog level (`/aggregations`) and at the Collection level (`/<collection_id>/aggregations`). Details for supported aggregations can be found in [the aggregation docs](./docs/src/aggregation.md)
|
|
321
321
|
|
|
322
322
|
## Rate Limiting
|
|
323
323
|
|
|
@@ -140,26 +140,38 @@ def to_es(query: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
140
140
|
ComparisonOp.GT,
|
|
141
141
|
ComparisonOp.GTE,
|
|
142
142
|
]:
|
|
143
|
+
range_op = {
|
|
144
|
+
ComparisonOp.LT: "lt",
|
|
145
|
+
ComparisonOp.LTE: "lte",
|
|
146
|
+
ComparisonOp.GT: "gt",
|
|
147
|
+
ComparisonOp.GTE: "gte",
|
|
148
|
+
}
|
|
149
|
+
|
|
143
150
|
field = to_es_field(query["args"][0]["property"])
|
|
144
151
|
value = query["args"][1]
|
|
145
152
|
if isinstance(value, dict) and "timestamp" in value:
|
|
146
|
-
# Handle timestamp fields specifically
|
|
147
153
|
value = value["timestamp"]
|
|
148
|
-
|
|
149
|
-
|
|
154
|
+
if query["op"] == ComparisonOp.EQ:
|
|
155
|
+
return {"range": {field: {"gte": value, "lte": value}}}
|
|
156
|
+
elif query["op"] == ComparisonOp.NEQ:
|
|
157
|
+
return {
|
|
158
|
+
"bool": {
|
|
159
|
+
"must_not": [{"range": {field: {"gte": value, "lte": value}}}]
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else:
|
|
163
|
+
return {"range": {field: {range_op[query["op"]]: value}}}
|
|
150
164
|
else:
|
|
151
165
|
if query["op"] == ComparisonOp.EQ:
|
|
152
166
|
return {"term": {field: value}}
|
|
153
167
|
elif query["op"] == ComparisonOp.NEQ:
|
|
154
168
|
return {"bool": {"must_not": [{"term": {field: value}}]}}
|
|
155
169
|
else:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}[query["op"]]
|
|
162
|
-
return {"range": {field: {range_op: value}}}
|
|
170
|
+
return {"range": {field: {range_op[query["op"]]: value}}}
|
|
171
|
+
|
|
172
|
+
elif query["op"] == ComparisonOp.IS_NULL:
|
|
173
|
+
field = to_es_field(query["args"][0]["property"])
|
|
174
|
+
return {"bool": {"must_not": {"exists": {"field": field}}}}
|
|
163
175
|
|
|
164
176
|
elif query["op"] == AdvancedComparisonOp.BETWEEN:
|
|
165
177
|
field = to_es_field(query["args"][0]["property"])
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""library version."""
|
|
2
|
-
__version__ = "3.2.
|
|
2
|
+
__version__ = "3.2.3"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: stac-fastapi.core
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.3
|
|
4
4
|
Summary: Core 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
|
|
@@ -285,17 +285,17 @@ A reindex operation might be useful to apply changes to documents or to correct
|
|
|
285
285
|
|
|
286
286
|
The index templates will make sure that manually created indices will also have the correct mappings and settings.
|
|
287
287
|
|
|
288
|
-
In this example, we will make a copy of an existing Item index `items_my-collection-000001` but change the Item identifier to be lowercase.
|
|
288
|
+
In this example, we will make a copy of an existing Item index `items_my-collection-lower_my-collection-hex-000001` but change the Item identifier to be lowercase.
|
|
289
289
|
|
|
290
290
|
```shell
|
|
291
291
|
curl -X "POST" "http://localhost:9200/_reindex" \
|
|
292
292
|
-H 'Content-Type: application/json' \
|
|
293
293
|
-d $'{
|
|
294
294
|
"source": {
|
|
295
|
-
"index": "items_my-collection-000001"
|
|
295
|
+
"index": "items_my-collection-lower_my-collection-hex-000001"
|
|
296
296
|
},
|
|
297
297
|
"dest": {
|
|
298
|
-
"index": "items_my-collection-000002"
|
|
298
|
+
"index": "items_my-collection-lower_my-collection-hex-000002"
|
|
299
299
|
},
|
|
300
300
|
"script": {
|
|
301
301
|
"source": "ctx._source.id = ctx._source.id.toLowerCase()",
|
|
@@ -304,7 +304,7 @@ curl -X "POST" "http://localhost:9200/_reindex" \
|
|
|
304
304
|
}'
|
|
305
305
|
```
|
|
306
306
|
|
|
307
|
-
If we are happy with the data in the newly created index, we can move the alias `items_my-collection` to the new index `items_my-collection-000002`.
|
|
307
|
+
If we are happy with the data in the newly created index, we can move the alias `items_my-collection` to the new index `items_my-collection-lower_my-collection-hex-000002`.
|
|
308
308
|
```shell
|
|
309
309
|
curl -X "POST" "http://localhost:9200/_aliases" \
|
|
310
310
|
-h 'Content-Type: application/json' \
|
|
@@ -318,7 +318,7 @@ curl -X "POST" "http://localhost:9200/_aliases" \
|
|
|
318
318
|
},
|
|
319
319
|
{
|
|
320
320
|
"add": {
|
|
321
|
-
"index": "items_my-collection-000002",
|
|
321
|
+
"index": "items_my-collection-lower_my-collection-hex-000002",
|
|
322
322
|
"alias": "items_my-collection"
|
|
323
323
|
}
|
|
324
324
|
}
|
|
@@ -335,7 +335,7 @@ Authentication is an optional feature that can be enabled through `Route Depende
|
|
|
335
335
|
|
|
336
336
|
## Aggregation
|
|
337
337
|
|
|
338
|
-
Aggregation of points and geometries, as well as frequency distribution aggregation of any other property including dates is supported in stac-fatsapi-elasticsearch-opensearch. Aggregations can be defined at the root Catalog level (`/aggregations`) and at the Collection level (`/<collection_id>/aggregations`). Details for supported aggregations can be found
|
|
338
|
+
Aggregation of points and geometries, as well as frequency distribution aggregation of any other property including dates is supported in stac-fatsapi-elasticsearch-opensearch. Aggregations can be defined at the root Catalog level (`/aggregations`) and at the Collection level (`/<collection_id>/aggregations`). Details for supported aggregations can be found in [the aggregation docs](./docs/src/aggregation.md)
|
|
339
339
|
|
|
340
340
|
## Rate Limiting
|
|
341
341
|
|
|
File without changes
|
|
File without changes
|
{stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/base_database_logic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/extensions/__init__.py
RENAMED
|
File without changes
|
{stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi/core/extensions/aggregation.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
|
{stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi.core.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{stac_fastapi.core-3.2.2 → stac_fastapi.core-3.2.3}/stac_fastapi.core.egg-info/top_level.txt
RENAMED
|
File without changes
|