# RangeFacet for multiple Fields

**URL:** https://discuss.elastic.co/t/rangefacet-for-multiple-fields/9901
**Category:** Elasticsearch
**Created:** [November 30, 2012, 10:38am UTC](https://discuss.elastic.co/t/rangefacet-for-multiple-fields/9901 "2012-11-30T10:38:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![thanuja\_gandhi](https://avatars.discourse-cdn.com/v4/letter/t/dc4da7/32.png) [@thanuja\_gandhi](https://discuss.elastic.co/u/thanuja_gandhi)
#### Post date: [November 30, 2012, 10:38am UTC](https://discuss.elastic.co/t/rangefacet-for-multiple-fields/9901/1 "2012-11-30T10:38:40Z")

</div>

Hi All,

Is there any way to add range facet for multiple fields?.

--

---

<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: [November 30, 2012, 10:49am UTC](https://discuss.elastic.co/t/rangefacet-for-multiple-fields/9901/2 "2012-11-30T10:49:12Z")

</div>

Do you really want range facet for multiple fields or many range facets?

For the first, I don't know.  
For the second option, you can compute many facets in the same query, so have a  
range1 facet on field1, and a range2 facet on field2, even a range3 facet on  
field1 with different thresholds.

Le 30 novembre 2012 à 11:38, thanuja [thanu27@gmail.com](mailto:thanu27@gmail.com) a écrit :

> Hi All,
> 
> Is there any way to add range facet for multiple fields?.
> 
> --

--  
David Pilato  
[http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<div class="post-metadata">

### Author: ![thanuja\_gandhi](https://avatars.discourse-cdn.com/v4/letter/t/dc4da7/32.png) [@thanuja\_gandhi](https://discuss.elastic.co/u/thanuja_gandhi)
#### Post date: [November 30, 2012, 11:11am UTC](https://discuss.elastic.co/t/rangefacet-for-multiple-fields/9901/3 "2012-11-30T11:11:39Z")

</div>

Thanks David. I need the curl like this,

"range4" : {  
"\_type" : "range",  
"ranges" : [ {  
"to" : 0.0,  
"count" : 0,  
"total\_count" : 0,  
"total" : 0.0,  
"mean" : 0.0  
}, {  
"from" : 1.0,  
"to" : 1000.0,  
"count" : 2,  
"min" : 16.0,  
"max" : 164.0,  
"total\_count" : 1,  
"total" : 164.0,  
"mean" : 164.0  
} ]

Here , single facet which holds multiple ranges across different fields. Is  
there any way to achieve this?

On Fri, Nov 30, 2012 at 4:19 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> \*\*  
> Do you really want range facet for multiple fields or many range facets?
> 
> For the first, I don't know.  
> For the second option, you can compute many facets in the same query, so  
> have a range1 facet on field1, and a range2 facet on field2, even a range3  
> facet on field1 with different thresholds.
> 
> Le 30 novembre 2012 à 11:38, thanuja [thanu27@gmail.com](mailto:thanu27@gmail.com) a écrit :
> 
> Hi All,
> 
> Is there any way to add range facet for multiple fields?.
> 
> --
> 
> --  
> David Pilato  
> [http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> --

--

---

<div class="post-metadata">

### Author: ![thanuja\_gandhi](https://avatars.discourse-cdn.com/v4/letter/t/dc4da7/32.png) [@thanuja\_gandhi](https://discuss.elastic.co/u/thanuja_gandhi)
#### Post date: [November 30, 2012, 11:18am UTC](https://discuss.elastic.co/t/rangefacet-for-multiple-fields/9901/4 "2012-11-30T11:18:52Z")

</div>

I will explain a little bit more.

I need to do single facet which has many ranges across multiple fields.

"range4" : {  
"\_type" : "range",  
"ranges" : [ {  
"to" : 0.0,  
"count" : 0,  
"total\_count" : 0,  
"total" : 0.0,  
"mean" : 0.0  
}, {  
"from" : 1.0,  
"to" : 1000.0,  
"count" : 2,  
"min" : 16.0,  
"max" : 164.0,  
"total\_count" : 2,  
"total" : 180.0,  
"mean" : 90.0  
} ]

On Fri, Nov 30, 2012 at 4:41 PM, thanuja gandhi [thanu27@gmail.com](mailto:thanu27@gmail.com) wrote:

> "range4" : {  
> "\_type" : "range",  
> "ranges" : [ {  
> "to" : 0.0,  
> "count" : 0,  
> "total\_count" : 0,  
> "total" : 0.0,  
> "mean" : 0.0  
> }, {  
> "from" : 1.0,  
> "to" : 1000.0,  
> "count" : 2,  
> "min" : 16.0,  
> "max" : 164.0,  
> "total\_count" : 1,  
> "total" : 164.0,  
> "mean" : 164.0  
> } ]

--

---

<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, 3:02am UTC](https://discuss.elastic.co/t/rangefacet-for-multiple-fields/9901/5 "2017-07-06T03:02:00Z")

</div>


