# Automatic Range Filter. Possible?

**URL:** <https://discuss.elastic.co/t/automatic-range-filter-possible/15802>\
**Category:** Elasticsearch\
**Created:** [February 14, 2014, 2:31pm UTC](https://discuss.elastic.co/t/automatic-range-filter-possible/15802 "2014-02-14T14:31:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tchinkatchuk](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@Tchinkatchuk](https://discuss.elastic.co/u/Tchinkatchuk)\
**Post date:** [February 14, 2014, 2:31pm UTC](https://discuss.elastic.co/t/automatic-range-filter-possible/15802/1 "2014-02-14T14:31:58Z")

</div>

Hi everyone,

I have multiple facets on text, integer, date.

I use range filter on some integer facets but I have to "manually" set the  
range (from x to y, from y to z, ...)  
Is there a way to ask ES to do those steps automatically ?

I undersand that statical can help whit the mean value ... but it means to  
do 2 call just for one facets.  
Did I miss something ?

Thanks for any clue and have everyone a good day.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/34424ac2-e791-429f-bb2d-3712a0d9b237%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/34424ac2-e791-429f-bb2d-3712a0d9b237%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [February 14, 2014, 3:42pm UTC](https://discuss.elastic.co/t/automatic-range-filter-possible/15802/2 "2014-02-14T15:42:48Z")

</div>

Would the histogram facet work for you?

[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-histogram-facet.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-histogram-facet.html)

BTW, if you've upgraded to 1.0, you might want to look at aggregations  
which are more powerful than facets.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/308d0542-b43c-49b9-8d08-ebd4eafe1ffe%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/308d0542-b43c-49b9-8d08-ebd4eafe1ffe%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tchinkatchuk](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@Tchinkatchuk](https://discuss.elastic.co/u/Tchinkatchuk)\
**Post date:** [February 14, 2014, 3:45pm UTC](https://discuss.elastic.co/t/automatic-range-filter-possible/15802/3 "2014-02-14T15:45:39Z")

</div>

Hi,

This could work but the issue is the same.  
I do not want to tell the interval but I want elastic to choose for me.

Le vendredi 14 février 2014 16:42:48 UTC+1, Binh Ly a écrit :

> Would the histogram facet work for you?
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-histogram-facet.html)
> 
> BTW, if you've upgraded to 1.0, you might want to look at aggregations  
> which are more powerful than facets.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d15ad9a0-edb0-4fea-bf35-0d8674b4a924%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d15ad9a0-edb0-4fea-bf35-0d8674b4a924%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [February 14, 2014, 4:18pm UTC](https://discuss.elastic.co/t/automatic-range-filter-possible/15802/4 "2014-02-14T16:18:09Z")

</div>

There is no automatic bucketing in Elasticsearch. I mimic the behavior with  
an expensive process that uses many smaller fixed ranges which are reduced  
into the number of buckets needed on the client side. Easily the slowest  
part of my query. My goal was to wait for the facet refactor (which has  
since become aggregations) before attempting a better server side  
implementation, but now I am too busy to revisit it.

Cheers,

Ivan

On Fri, Feb 14, 2014 at 7:45 AM, Georges@Bibtol [sg@quable.fr](mailto:sg@quable.fr) wrote:

> Hi,
> 
> This could work but the issue is the same.  
> I do not want to tell the interval but I want elastic to choose for me.
> 
> Le vendredi 14 février 2014 16:42:48 UTC+1, Binh Ly a écrit :
> 
> > Would the histogram facet work for you?
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/)  
> > reference/current/search-facets-histogram-facet.html
> > 
> > BTW, if you've upgraded to 1.0, you might want to look at aggregations  
> > which are more powerful than facets.
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d15ad9a0-edb0-4fea-bf35-0d8674b4a924%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d15ad9a0-edb0-4fea-bf35-0d8674b4a924%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDT%3DRoR6U0pr8c365m6Ef%3D-%3D5eOYKeoszg%2B6WXXCu6H6w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDT%3DRoR6U0pr8c365m6Ef%3D-%3D5eOYKeoszg%2B6WXXCu6H6w%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Brian\_Hudson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brian_hudson/32/1306_2.png) [@Brian\_Hudson](https://discuss.elastic.co/u/Brian_Hudson)\
**Post date:** [February 14, 2014, 7:46pm UTC](https://discuss.elastic.co/t/automatic-range-filter-possible/15802/5 "2014-02-14T19:46:54Z")

</div>

When creating histograms for my UI if the user does not provide the number  
of bins/interval I'm finding the min and max values using the new min & max  
aggregations and then computing the number of bins/interval using the Rice  
Rule described  
here:[Histogram - Wikipedia](http://en.wikipedia.org/wiki/Histogram#Number_of_bins_and_width)

I'm pretty happy with the results.

Brian

On Friday, February 14, 2014 9:31:58 AM UTC-5, Georges@Bibtol wrote:

> Hi everyone,
> 
> I have multiple facets on text, integer, date.
> 
> I use range filter on some integer facets but I have to "manually" set the  
> range (from x to y, from y to z, ...)  
> Is there a way to ask ES to do those steps automatically ?
> 
> I undersand that statical can help whit the mean value ... but it means to  
> do 2 call just for one facets.  
> Did I miss something ?
> 
> Thanks for any clue and have everyone a good day.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/593570b9-3b31-473f-8e71-c1af49bbae1b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/593570b9-3b31-473f-8e71-c1af49bbae1b%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [February 14, 2014, 8:04pm UTC](https://discuss.elastic.co/t/automatic-range-filter-possible/15802/6 "2014-02-14T20:04:40Z")

</div>

Here is a previous discussion on Rice/Sturges:  
[https://groups.google.com/forum/#!msg/elasticsearch/CAZhIHtB1UI/Exzd2\_DanbAJ](https://groups.google.com/forum/#!msg/elasticsearch/CAZhIHtB1UI/Exzd2_DanbAJ)

Never did sit down and finally understand the paper Jörg linked. 🙂 I  
really should find the time to revisit the issue since my implementation is  
costly.

Ivan

On Fri, Feb 14, 2014 at 11:46 AM, Brian Hudson [brian.r.hudson@gmail.com](mailto:brian.r.hudson@gmail.com)wrote:

> When creating histograms for my UI if the user does not provide the number  
> of bins/interval I'm finding the min and max values using the new min & max  
> aggregations and then computing the number of bins/interval using the Rice  
> Rule described here:  
> [Histogram - Wikipedia](http://en.wikipedia.org/wiki/Histogram#Number_of_bins_and_width)
> 
> I'm pretty happy with the results.
> 
> Brian
> 
> On Friday, February 14, 2014 9:31:58 AM UTC-5, Georges@Bibtol wrote:
> 
> > Hi everyone,
> > 
> > I have multiple facets on text, integer, date.
> > 
> > I use range filter on some integer facets but I have to "manually" set  
> > the range (from x to y, from y to z, ...)  
> > Is there a way to ask ES to do those steps automatically ?
> > 
> > I undersand that statical can help whit the mean value ... but it means  
> > to do 2 call just for one facets.  
> > Did I miss something ?
> > 
> > Thanks for any clue and have everyone a good day.
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/593570b9-3b31-473f-8e71-c1af49bbae1b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/593570b9-3b31-473f-8e71-c1af49bbae1b%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQA-WKoAdf0%3D8Pq9RAqX\_%3D%3DVs-ekh5Espf66T-Wez7AZKw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQA-WKoAdf0%3D8Pq9RAqX_%3D%3DVs-ekh5Espf66T-Wez7AZKw%40mail.gmail.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, 1:49am UTC](https://discuss.elastic.co/t/automatic-range-filter-possible/15802/7 "2017-07-06T01:49:58Z")

</div>


