# Problem with multiple range filters

**URL:** https://discuss.elastic.co/t/problem-with-multiple-range-filters/51929
**Category:** Elasticsearch
**Created:** [June 6, 2016, 11:07am UTC](https://discuss.elastic.co/t/problem-with-multiple-range-filters/51929 "2016-06-06T11:07:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mdogo](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@mdogo](https://discuss.elastic.co/u/mdogo)
#### Post date: [June 6, 2016, 11:07am UTC](https://discuss.elastic.co/t/problem-with-multiple-range-filters/51929/1 "2016-06-06T11:07:33Z")

</div>

I don't know if there is something wrong with my syntax but Elastic doesn't reply with an error code.

I have made a query that is like this:

```
{
    "query": {"query_string": {"query": "*"}},
    "filter": {
        "and": [
            {"range":
                 {"field_1": {"gte": X},
                   "field_2": {"lte": Y}
                 }
            }
        ]
    } 
}

```

This doen't raise any problem but the results doesn't make sense. There are documents that fulfill the filter criteria but none is shown.

When I perform the query this way:

```
{
    "query": {"query_string": {"query": "*"}},
    "filter": {
        "and": [
            {"range": {"field_1": {"gte": X}}},
            {"range": {"field_2": {"lte": Y}}},
        ]
    } 
}

```

I don't see the problem because for some indexes the first query works fine.

---

<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, 10:45pm UTC](https://discuss.elastic.co/t/problem-with-multiple-range-filters/51929/2 "2017-07-05T22:45:58Z")

</div>


