Skip to content

Commit ab62cd8

Browse files
Support for disabling attributes nested in properties. (#474)
**Description:** during testing I realized that sfoes skips check on nested attributes in the mapping. In result everything from properties is passed to ...collection/.../queryables endpoint. Example mapping: ``` { "mappings": { "dynamic_templates": [ { "descriptions": { "match": "description", "match_mapping_type": "string", "mapping": { "type": "text" } } }, { "titles": { "match": "title", "match_mapping_type": "string", "mapping": { "type": "text" } } }, { "proj_epsg": { "match": "proj:epsg", "mapping": { "type": "integer" } } }, { "proj_projjson": { "match": "proj:projjson", "mapping": { "enabled": false, "type": "object" } } }, { "proj_centroid": { "match": "proj:centroid", "mapping": { "type": "geo_point" } } }, { "proj_geometry": { "match": "proj:geometry", "mapping": { "enabled": false, "type": "object" } } }, { "no_index_href": { "match": "href", "mapping": { "index": false, "type": "text" } } }, { "strings": { "match_mapping_type": "string", "mapping": { "type": "keyword" } } }, { "long_to_double": { "match_mapping_type": "long", "mapping": { "type": "double" } } }, { "double_to_double": { "match_mapping_type": "double", "mapping": { "type": "double" } } } ], "numeric_detection": false, "properties": { "assets": { "type": "object", "enabled": false }, "bbox": { "type": "double" }, "collection": { "type": "keyword" }, "geometry": { "type": "geo_shape" }, "id": { "type": "keyword" }, "links": { "type": "object", "enabled": false }, "properties": { "properties": { "auth:schemes": { "type": "object", "enabled": false }, "constellation": { "type": "keyword" }, "created": { "type": "date" }, "datetime": { "type": "date" }, "end_datetime": { "type": "date" }, "eo:cloud_cover": { "type": "double" }, "eo:snow_cover": { "type": "double" }, "eopf:datastrip_id": { "type": "keyword" }, "eopf:datatake_id": { "type": "keyword" }, "eopf:instrument_mode": { "type": "keyword" }, "eopf:origin_datetime": { "type": "date" }, "grid:code": { "type": "keyword" }, "gsd": { "type": "double" }, "instruments": { "type": "keyword" }, "platform": { "type": "keyword" }, "processing:datetime": { "type": "date" }, "processing:facility": { "type": "keyword" }, "processing:level": { "type": "keyword" }, "processing:version": { "type": "keyword" }, "product:timeliness": { "type": "keyword" }, "product:timeliness_category": { "type": "keyword" }, "product:type": { "type": "keyword" }, "published": { "type": "date" }, "sar:instrument_mode": { "type": "keyword" }, "sat:absolute_orbit": { "type": "integer" }, "sat:orbit_state": { "type": "keyword" }, "sat:platform_international_designator": { "type": "keyword" }, "sat:relative_orbit": { "type": "integer" }, "start_datetime": { "type": "date" }, "statistics": { "type": "object", "enabled": false }, "storage:schemes": { "type": "object", "enabled": false }, "updated": { "type": "date" }, "view:azimuth": { "type": "double" }, "view:incidence_angle": { "type": "double" }, "view:sun_azimuth": { "type": "double" }, "view:sun_elevation": { "type": "double" } } }, "stac_extensions": { "type": "keyword" }, "stac_version": { "type": "keyword" }, "type": { "type": "keyword" } } } } ``` **PR Checklist:** - [x] Code is formatted and linted (run `pre-commit run --all-files`) - [x] Tests pass (run `make test`) - [x] Documentation has been updated to reflect changes, if applicable - [x] Changes are added to the changelog --------- Co-authored-by: Jonathan Healy <[email protected]>
1 parent 0a654da commit ab62cd8

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ dmypy.json
135135
# Virtualenv
136136
venv
137137

138+
# VSCode folder
139+
.vscode
140+
138141
/docs/src/api/*
139142

140143
.DS_Store

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1515

1616
### Fixed
1717

18+
- support of disabled nested attributes in the properties dictionary. [#474](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/474)
1819

1920
## [v6.4.0] - 2025-09-24
2021

stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ async def get_queryables(
7272
field_properties = field_def.get("properties")
7373
if field_properties:
7474
stack.extend(
75-
(f"{field_fqn}.{k}", v) for k, v in field_properties.items()
75+
(f"{field_fqn}.{k}", v)
76+
for k, v in field_properties.items()
77+
if v.get("enabled", True)
7678
)
7779

7880
# Skip non-indexed or disabled fields

0 commit comments

Comments
 (0)