# How to fetch data from elasticsearch based on stored field(date)

**URL:** <https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-based-on-stored-field-date/73826>\
**Category:** Elasticsearch\
**Created:** [February 3, 2017, 10:37am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-based-on-stored-field-date/73826 "2017-02-03T10:37:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@srikanth](https://discuss.elastic.co/u/srikanth)\
**Post date:** [February 3, 2017, 10:37am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-based-on-stored-field-date/73826/1 "2017-02-03T10:37:10Z")

</div>

I am using java REST client api to fetch data from elasticsearch. Here i am fetching data based on id ie, "twitter/tweet/1", but i want to retrieve all the the records for the given date. is there any way to filter it?

---

<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:** [February 3, 2017, 11:34am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-based-on-stored-field-date/73826/2 "2017-02-03T11:34:09Z")

</div>

This?

```auto
GET _search
{
    "query": {
        "range" : {
            "created_at" : {
                "gte": "01/01/2017"
            }
        }
    }
}

```

---

<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:** [March 3, 2017, 11:34am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-based-on-stored-field-date/73826/3 "2017-03-03T11:34:17Z")

</div>

Closed on March 3, 2017, 11:34am UTC

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