# Multi Range filter for number not working

**URL:** https://discuss.elastic.co/t/multi-range-filter-for-number-not-working/45211
**Category:** Elasticsearch
**Created:** [March 23, 2016, 11:11am UTC](https://discuss.elastic.co/t/multi-range-filter-for-number-not-working/45211 "2016-03-23T11:11:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![84shalinisingh](https://avatars.discourse-cdn.com/v4/letter/8/f17d59/32.png) [@84shalinisingh](https://discuss.elastic.co/u/84shalinisingh)
#### Post date: [March 23, 2016, 11:11am UTC](https://discuss.elastic.co/t/multi-range-filter-for-number-not-working/45211/1 "2016-03-23T11:11:37Z")

</div>

Hi All,

I am using elastic search version 1.4.2.  
I am applying range filter which works fine for one range.  
"filters" : [ {  
"and" : {  
"filters" : [ {  
"range" : {  
"age" : {  
"from" : 24.0,  
"to" : 36.0,  
"include\_lower" : true,  
"include\_upper" : false  
}  
}  
} ]

But when I apply filter for multiple ranges, it does not work. I get wrong results.  
"filters" : [ {  
"and" : {  
"filters" : [ {  
"and" : {  
"filters" : [ {  
"range" : {  
"age" : {  
"from" : 24.0,  
"to" : 36.0,  
"include\_lower" : true,  
"include\_upper" : false  
}  
}  
}, {  
"range" : {  
"age" : {  
"from" : 36.0,  
"to" : 50.0,  
"include\_lower" : true,  
"include\_upper" : false  
}  
}  
} ]  
}  
} ]  
}  
} ]

Thanks  
Shalini

---

<div class="post-metadata">

### Author: ![84shalinisingh](https://avatars.discourse-cdn.com/v4/letter/8/f17d59/32.png) [@84shalinisingh](https://discuss.elastic.co/u/84shalinisingh)
#### Post date: [March 23, 2016, 2:54pm UTC](https://discuss.elastic.co/t/multi-range-filter-for-number-not-working/45211/2 "2016-03-23T14:54:22Z")

</div>

My bad, I should have applied or filter instead of and filter.😀

---

<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, 11:05pm UTC](https://discuss.elastic.co/t/multi-range-filter-for-number-not-working/45211/3 "2017-07-05T23:05:51Z")

</div>


