Query available documents

Hello there,

I would like to perform a search that complies to these rules:

Imagine

  • the horizontal line is date/time
  • the red rectangles are indexed unavailable date ranges in form of:
    [
    {
    "from": "2016-11-10T00:00:00+00:00"
    "to": "2016-11-15T00:00:00+00:00"
    },
    {
    "from": "2016-11-03T00:00:00+00:00"
    "to": "2016-11-06T00:00:00+00:00"
    },
    ...
    ]
  • the brackets represent the kind of searches I want to perform (providing startDate and endDate) and if or not to return results

How could I achieve something like this?

Grateful for any help!

Best regards

japel