# Bool query with range

**URL:** <https://discuss.elastic.co/t/bool-query-with-range/117321>\
**Category:** Elasticsearch\
**Created:** [January 27, 2018, 6:26pm UTC](https://discuss.elastic.co/t/bool-query-with-range/117321 "2018-01-27T18:26:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![riccardone1](https://avatars.discourse-cdn.com/v4/letter/r/e68b1a/32.png) [@riccardone1](https://discuss.elastic.co/u/riccardone1)\
**Post date:** [January 27, 2018, 6:26pm UTC](https://discuss.elastic.co/t/bool-query-with-range/117321/1 "2018-01-27T18:26:26Z")

</div>

Hi

Given that in my index there is a document with "LogType": "Terapy" and "LogDate": { "gte": "2015-01-01"}

why the following bool query doesn't return any document?

{  
"query": {  
"bool" : {  
"must" : {  
"term" : { "LogType" : "Terapy" }  
},  
"should": {  
"range" : {  
"LogDate" : { "gte" : "2015-01-01" }  
}  
}  
}  
}  
}

Thanks

---

<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:** [January 27, 2018, 7:06pm UTC](https://discuss.elastic.co/t/bool-query-with-range/117321/2 "2018-01-27T19:06:28Z")

</div>

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

Or use markdown style like:

````
```
CODE
```

````

Please edit your post.

Try with `terapy` instead.

---

<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:** [February 24, 2018, 7:06pm UTC](https://discuss.elastic.co/t/bool-query-with-range/117321/3 "2018-02-24T19:06:30Z")

</div>

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