Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IS NULL filter operator #300

Open
jamesfisher-geo opened this issue Sep 18, 2024 · 0 comments
Open

IS NULL filter operator #300

jamesfisher-geo opened this issue Sep 18, 2024 · 0 comments

Comments

@jamesfisher-geo
Copy link
Collaborator

jamesfisher-geo commented Sep 18, 2024

Describe the bug
IS NULL is included in the filter extension logic. However, I cannot get it to work with cql2-json or cql2-text.

To Reproduce
Steps to reproduce the behavior:

  1. docker compose up app-opensearch or docker compose up app-elasticsearch
  2. python3 data_loader.py --base-url http://localhost:8082
  3. Try the following:
    POST http://localhost:8082/search
    body
{
  "filter-lang": "cql2-json",
  "filter": {
            "op": "isNull",
            "args": [ { "property": "sentinel:data_coverage" } ]
          }

}
{
    "detail": "Error with cql2_json filter: Q() can only accept dict with a single query ({\"match\": {...}}). Instead it got ({})"
}

GET http://localhost:8082/search?filter=sentinel:data_coverage > 50 OR landsat:coverage_percent < 10 OR (sentinel:data_coverage IS NULL AND landsat:coverage_percent IS NULL)

{
    "detail": "Error with cql2_json filter: Q() can only accept dict with a single query ({\"match\": {...}}). Instead it got ({})"
}

Expected behavior
valid ItemCollection

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

No branches or pull requests

1 participant