Skip to content

Conversation

MathewNWSH
Copy link
Contributor

@MathewNWSH MathewNWSH commented Sep 26, 2025

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:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable
  • Changes are added to the changelog

@jonhealy1 jonhealy1 self-requested a review September 27, 2025 05:35
Copy link
Collaborator

@jonhealy1 jonhealy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch @MathewNWSH!

@jonhealy1 jonhealy1 merged commit ab62cd8 into stac-utils:main Sep 27, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants