I am trying to filter my index by a “virtual status”. All data items have a start_date and an end_date as a timestamp. There are 4 virtual status cases:
- DRAFT - start_date = 0
- SCHEDULED - start_date in the future
- ONLINE - start_date in the past, end_date in the future
- OFFLINE - end_date in the past
So if I want all data sets for ONLINE this would be where todays date is between the start_date and the end_date. I can get that by adding a filter like
start_date < 1603727634 AND 1603727634 < end_date that for example.
Now, I want to query for DRAFT and ONLINE so I tried to combine some filters like this:
start_date = 0 OR (start_date < 1603727634 AND 1603727634 < end_date). Unfortunately this leads to the error
filter (X AND Y) OR Z is not allowed, only (X OR Y) AND Z is allowed.
How am I supposed to query in this scenario? Do I have to restructure my data? If yes, how could I do that since the status depends on the current date?
I really didn’t expect a blocker like that. I am really hoping for help and would appriciate every idea how to go about this problem