Skip to content

Filtering behavior on array fields? #36

@emmanuelmathot

Description

@emmanuelmathot

I am struggling finding out the proper filtering behaviour for array fields. The only example I find in the spec is the Example 15

Example 15 : Using the IN List predicate

The predefined function IN allows for checking if a value is in a list of values.

Example 15: cql2-text (GET)

filter=keywords IN ('fire', 'forest', 'wildfire')

Example 15: cql2-json (POST)

{
    "filter-lang": "cql2-json",
    "filter": {
        "op": "in",
        "args": [
            {
                "property": "keywords"
            },
            [
                "fire",
                "forest",
                "wildfire"
            ]
        ]
    }
}

My understanding is that any items with any of the "fire", "forest", "wildfire" string in the keywords array field will be returned.

What about the following example:

filter=keywords = 'fire'

cql2-json (POST)

{
    "filter-lang": "cql2-json",
    "filter": {
        "op": "eq",
        "args": [
            {
                "property": "keywords"
            },
            "fire"
        ]
    }
}

I would expect that any items with the "fire" string in the keywords array field will be returned. From a user pov and STAC browser current implementation, I believe this is how it should be handled.

cc @bitnerd @philvarner @gadomski @jonhealy1 @batpad

If we agree, can we precise the filtering behaviour in the spec?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions