# Date range filter for document with multiple dates

**URL:** <https://discuss.elastic.co/t/date-range-filter-for-document-with-multiple-dates/90037>\
**Category:** Elasticsearch\
**Created:** [June 20, 2017, 5:54am UTC](https://discuss.elastic.co/t/date-range-filter-for-document-with-multiple-dates/90037 "2017-06-20T05:54:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HritikJain](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@HritikJain](https://discuss.elastic.co/u/HritikJain)\
**Post date:** [June 20, 2017, 5:54am UTC](https://discuss.elastic.co/t/date-range-filter-for-document-with-multiple-dates/90037/1 "2017-06-20T05:54:04Z")

</div>

Hello Guys,

I am working with Event type of system. Where we have multiple dates for the same event like:

![](https://us1.discourse-cdn.com/elastic/original/3X/d/6/d64ddc4ea9072f81c779822fd1139b30ca4422a8.png)

And the values are comma separated, like: 2017-06-03,2017-06-05,2017-06-07 and the data map is:

```
{
  "mappings": {
    "my_type": {
      "properties": {
        "event_date": {
          "type": "date",
          "format": "yyyy-MM-dd"
        }
      }
    }
  }
}

```

But in this case the document is not able to index to elasticsearch.

Please help me, how I can index this and add the range filter?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 20, 2017, 6:28am UTC](https://discuss.elastic.co/t/date-range-filter-for-document-with-multiple-dates/90037/2 "2017-06-20T06:28:04Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

I believe you can index that as:

```auto
{
  "event_date": ["2017-06-02", "2017-06-04", "2017-06-06"]
}

```

Unsure if this will solve your use case though.

---

<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 18, 2017, 6:28am UTC](https://discuss.elastic.co/t/date-range-filter-for-document-with-multiple-dates/90037/3 "2017-07-18T06:28:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
