# Java API Multiple range queries

**URL:** <https://discuss.elastic.co/t/java-api-multiple-range-queries/12025>\
**Category:** Elasticsearch\
**Created:** [May 19, 2013, 12:43pm UTC](https://discuss.elastic.co/t/java-api-multiple-range-queries/12025 "2013-05-19T12:43:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dantuff](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@dantuff](https://discuss.elastic.co/u/dantuff)\
**Post date:** [May 19, 2013, 12:43pm UTC](https://discuss.elastic.co/t/java-api-multiple-range-queries/12025/1 "2013-05-19T12:43:53Z")

</div>

Is it possible to add multiple range queries using the Java API? I can get  
to work with one range query using:

searchRequestBuilder.setFilter(rangeFilterBuilder);

Is there a way to add multiple range queries to the SearchRequestBuilder  
object?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [May 19, 2013, 12:49pm UTC](https://discuss.elastic.co/t/java-api-multiple-range-queries/12025/2 "2013-05-19T12:49:24Z")

</div>

You need to use a `bool` filter to combine each range filter

clint

On 19 May 2013 14:43, es newbie [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com) wrote:

> Is it possible to add multiple range queries using the Java API? I can get  
> to work with one range query using:
> 
> searchRequestBuilder.setFilter(rangeFilterBuilder);
> 
> Is there a way to add multiple range queries to the SearchRequestBuilder  
> object?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [May 19, 2013, 1:20pm UTC](https://discuss.elastic.co/t/java-api-multiple-range-queries/12025/3 "2013-05-19T13:20:33Z")

</div>

You can use a BoolFilter or AndFilter.  
See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/query-dsl-filters/)

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 19 mai 2013 à 14:43, es newbie [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com) a écrit :

> Is it possible to add multiple range queries using the Java API? I can get to work with one range query using:
> 
> searchRequestBuilder.setFilter(rangeFilterBuilder);
> 
> Is there a way to add multiple range queries to the SearchRequestBuilder object?
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:35am UTC](https://discuss.elastic.co/t/java-api-multiple-range-queries/12025/4 "2017-07-06T02:35:47Z")

</div>


