Closed
Description
Describe the bug
Searching items filtering by properties with floats returns wrong results. Clause converts input query to ES filter using this Union. Because int
is defined before float
, all numeric values are converted to integer.
To Reproduce
Steps to reproduce the behavior:
- Start & ingest S2L2A sample data
- Run filter:
{
"collections": ["test-collection"],
"limit": 2,
"fields": {
"include": [
"properties.eo:cloud_cover"
]
},
"filter-lang": "cql2-json",
"filter": {
"op": "and",
"args": [
{
"op": ">=",
"args": [{"property": "properties.eo:cloud_cover"}, 0.02]
},
{
"op": "<=",
"args": [{"property": "properties.eo:cloud_cover"}, 0.04]
}
]
}
}
- See outputs, items have
properties.eo:cloud_cover
as 0, because the filter is sent with 0es. The collection has one item with 0.03 (id:S2B_1CCV_20220106_0_L2A
), this should be the right result.
Expected behavior
Number should not be cast to int.
Screenshots
Changing order, all numbers are converted to float
Metadata
Metadata
Assignees
Labels
No labels