How to store disjoint date ranges and then search for a specific range

I am trying to store hotel room availability in elasticsearch. And then I need to
search rooms those are available from a date till another date. I have come up with
two ways to store data for availability, and they are as follows:

Here availability dictionary store all dates and value of each date key is true of false, representing its available on
that day or not.

{
  "_id": "khg2uo47tyhgjwebu7624787",
  "room_type": "garden view",
  "hotel_name": "Cool hotel",
  "hotel_id": "jytu64r982u0299023",
  "room_metadata1": 233,
  "room_color": "black",
  "availability": {
    "2016-07-01": true,
    "2016-07-02": true,
    "2016-07-03": false,
    "2016-07-04": true,
    "2016-07-05": true,
    "2016-07-06": null,
    "2016-07-07": true,
    "2016-07-08": true,
    ----
    ----
    for 365 days 
  }

}

Here availability array only stores those dates when room is available

{
  "_id": "khg2uo47tyhgjwebu7624787",
  "room_type": "garden view",
  "hotel_name": "Cool hotel",
  "hotel_id": "jytu64r982u0299023",
  "room_metadata1": 535,
  "room_color": "black",
  "availability": ["2016-07-01", "2016-07-02", "2016-07-04", "2016-07-05", "2016-07-07", "2016-07-08"] ---for 365 days
  }
}

I want to search all rooms, those are available from from_date till to_date and that should look into availability dictionary or array. And my date range may span up to 365 days (e.g. 2016-01-01 to 2016-12-31)

Question 1) How to store these availability data , so that I can perform the above search easily?
Question 2) I could not find any way to search through range of dates, so any suggestion?

Please note, items
in availability may not be kept sorted. And I may have more than 100 million records to search through.

Hey,

wouldnt you be able to search for available dates by just making sure that the data is set with a query like this

GET test/_search
{
  "query": {
    "bool": {
      "filter": [
        { "term": { "availability": "2016-07-01" } },
        { "term": { "availability": "2016-07-02" } }
      ]
    }
  }
}

Instead of a range query, just add each required day manually?

--Alex

Thanks @spinscale for the idea. But here is the caveat. If I have to search for a room available from June 1st till Dec 31. That means I will have to manually pass 6x30=180 days. Is that scalable? I doubt. ...what is your opinion?

If you already have the data, why not give it a try and see if it matches the SLA you set for yourself?

If it does not match your SLA, you could add some client code, that indexes a full month availability as 2016-07 and search for that term for a full month?