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

**URL:** https://discuss.elastic.co/t/how-to-store-disjoint-date-ranges-and-then-search-for-a-specific-range/52935
**Category:** Elasticsearch
**Created:** [June 16, 2016, 2:27am UTC](https://discuss.elastic.co/t/how-to-store-disjoint-date-ranges-and-then-search-for-a-specific-range/52935 "2016-06-16T02:27:18Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [June 16, 2016, 8:28am UTC](https://discuss.elastic.co/t/how-to-store-disjoint-date-ranges-and-then-search-for-a-specific-range/52935/2 "2016-06-16T08:28:37Z")

</div>

Hey,

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

```json
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

---

_[View the full topic](https://discuss.elastic.co/t/how-to-store-disjoint-date-ranges-and-then-search-for-a-specific-range/52935)._
