# Include date range in \_all search

**URL:** https://discuss.elastic.co/t/include-date-range-in--all-search/45118
**Category:** Elasticsearch
**Created:** [March 22, 2016, 3:02pm UTC](https://discuss.elastic.co/t/include-date-range-in--all-search/45118 "2016-03-22T15:02:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lacollam](https://avatars.discourse-cdn.com/v4/letter/l/6a8cbe/32.png) [@lacollam](https://discuss.elastic.co/u/lacollam)
#### Post date: [March 22, 2016, 3:02pm UTC](https://discuss.elastic.co/t/include-date-range-in--all-search/45118/1 "2016-03-22T15:02:07Z")

</div>

My current query below works great. You can assume 'first', 'last', and 'dateOfBirth' is included in \_all.

```auto
{
  "query": {
        "match": {
           "_all": {
               "query": "foo bar",
               "operator": "and",
               "fuzziness": 1,
               "prefix_length": 1
           }
        }
    }
}

```

Now, I wanted to add a layer of intuitive search on dates that allow different format of date search capability. For example, input of January 1, 1998 and 01/01/1998. My proof of concept below works for search DIRECTLY on the DateOfBirth field.

```auto
{
  "query": {
    "range": {
      "dateofBirth": {
        "lte": "March 16, 2016",
        "gte": "03/16/2016",
        "format": "MM/dd/yyyy||MMMM dd, yyyy"
      }
    }
  }
}

```

Now comes the big question, how do i take this proof of concept and make it one query where I can search across \_all field (first, last, dateOfBirth) with the intuitive search??? It will be one query with one input box from a user. I appreciate any help! 🙂

Example 1: John Doe March 16, 2016

Example 2: John Doe 03/16/2016

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 11:06pm UTC](https://discuss.elastic.co/t/include-date-range-in--all-search/45118/2 "2017-07-05T23:06:15Z")

</div>


