# Finding the min and max value for a float/double field

**URL:** <https://discuss.elastic.co/t/finding-the-min-and-max-value-for-a-float-double-field/3926>\
**Category:** Elasticsearch\
**Created:** [February 14, 2011, 3:16pm UTC](https://discuss.elastic.co/t/finding-the-min-and-max-value-for-a-float-double-field/3926 "2011-02-14T15:16:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enrique\_Medina\_Monte](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@Enrique\_Medina\_Monte](https://discuss.elastic.co/u/Enrique_Medina_Monte)\
**Post date:** [February 14, 2011, 3:16pm UTC](https://discuss.elastic.co/t/finding-the-min-and-max-value-for-a-float-double-field/3926/1 "2011-02-14T15:16:47Z")

</div>

Hi,

What would the best way to get the MAX/MIN values for a specific field in a  
search?

For instance, I'm indexing products, and they have an amount field, and when  
I search for anything, I want to get the MAX/MIN amount for all the results,  
so I can show a slider where the user can filter again the results based on  
a range [MIN..MAX] of the amount.

Example: I search for "iPhone", and I get 12456 results. I'd like to get  
also which is the MIN and the MAX amount for those results; let's say it's  
$200 and $900, respectively.

Thanks.

---

<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:** [February 14, 2011, 3:23pm UTC](https://discuss.elastic.co/t/finding-the-min-and-max-value-for-a-float-double-field/3926/2 "2011-02-14T15:23:16Z")

</div>

Hi Enrique

> What would the best way to get the MAX/MIN values for a specific field  
> in a search?

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

clint

---

<div class="post-metadata">

**Author:** ![Enrique\_Medina\_Monte](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@Enrique\_Medina\_Monte](https://discuss.elastic.co/u/Enrique_Medina_Monte)\
**Post date:** [February 14, 2011, 3:36pm UTC](https://discuss.elastic.co/t/finding-the-min-and-max-value-for-a-float-double-field/3926/3 "2011-02-14T15:36:04Z")

</div>

Thanks, everything's so easy in ES 🙂

On Mon, Feb 14, 2011 at 4:23 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> Hi Enrique
> 
> > What would the best way to get the MAX/MIN values for a specific field  
> > in a search?
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/facets/statistical-facet.html)
> 
> clint

---

<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, 4:12am UTC](https://discuss.elastic.co/t/finding-the-min-and-max-value-for-a-float-double-field/3926/4 "2017-07-06T04:12:06Z")

</div>


