Skip to content

Datetime filter #391

Open
Open
@GrzegorzPustulka

Description

@GrzegorzPustulka

Describe the bug
If we make a query using a datetime filter, the query searches for the given date between datetime or start_datetime, end_datetime or start and end_datetime. Below I'm including what the query looks like that the apply_datetime_filter function applies. This seems pointless to me - the user is asking about datetime, not about start_datetime and end_datetime fields. If the user is supposed to be able to search by these fields, they need to be added as separate search fields.

[Bool(filter=[Range(properties__datetime={'gte': '2016-05-23T10:41:10Z', 'lte': '2016-06-23T10:41:10Z'})]), Bool(filter=[Range(properties__start_datetime={'gte': '2016-05-23T10:41:10Z', 'lte': '2016-06-23T10:41:10Z'})]), Bool(filter=[Range(properties__end_datetime={'gte': '2016-05-23T10:41:10Z', 'lte': '2016-06-23T10:41:10Z'})]), Bool(filter=[Range(properties__start_datetime={'lte': '2016-05-23T10:41:10Z'}), Range(properties__end_datetime={'gte': '2016-06-23T10:41:10Z'})])]

To Reproduce
http://127.0.0.1:8080/search?collections=sentinel-2-l2a&datetime=2016-05-23T10:41:10.947Z/2016-06-23T10:41:10.947Z

Expected behavior
The API should return only dates between datetime and datetime, not use start_datetime and end_datetime

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