# Elastic search (Spring data elastic search)- Date filter(range) not working as expected

**URL:** <https://discuss.elastic.co/t/elastic-search-spring-data-elastic-search-date-filter-range-not-working-as-expected/94055>\
**Category:** Elasticsearch\
**Created:** [July 21, 2017, 4:18am UTC](https://discuss.elastic.co/t/elastic-search-spring-data-elastic-search-date-filter-range-not-working-as-expected/94055 "2017-07-21T04:18:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [July 28, 2017, 9:10am UTC](https://discuss.elastic.co/t/elastic-search-spring-data-elastic-search-date-filter-range-not-working-as-expected/94055/2 "2017-07-28T09:10: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 edited your post.

I'm a bit confused by:

```auto
{
  "bool" : {
    "must" : {
      "match_all" : { }
    }
  }
},
{
  "range" : {
    "timestamp" : {
      "from" : "13/06/2017 10:20",
      "to" : "18/06/2017 15:30",
      "format" : "dd/MM/yyyy HH:mm",
      "include_lower" : true,
      "include_upper" : true
    }
  }
}

```

It's "pseudocode" or what? I mean that the query DSL looks wrong here.  
The range part should be within a filter clause which we don't see here.

Could you reproduce with [a simple script](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) what you see (outside the context of Spring) just by using Kibana REST Console? Then we can start to iterate from there.

---

_[View the full topic](https://discuss.elastic.co/t/elastic-search-spring-data-elastic-search-date-filter-range-not-working-as-expected/94055)._
