# Range Filter Aggregation on array

**URL:** <https://discuss.elastic.co/t/range-filter-aggregation-on-array/20104>\
**Category:** Elasticsearch\
**Created:** [October 7, 2014, 8:36am UTC](https://discuss.elastic.co/t/range-filter-aggregation-on-array/20104 "2014-10-07T08:36:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Remi\_Nonnon](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@Remi\_Nonnon](https://discuss.elastic.co/u/Remi_Nonnon)\
**Post date:** [October 7, 2014, 8:36am UTC](https://discuss.elastic.co/t/range-filter-aggregation-on-array/20104/1 "2014-10-07T08:36:24Z")

</div>

Hi all,

I have some troubles when I try to use Range Filter aggregation on an array.

Example of 1 document :

```json
{
   "_index": "test",
   "_type": "values",
   "_id": "1",
   "_version": 1,
   "found": true,
   "_source": {
      "array": [927,425,455,120]
    }
}

```

For all my "values" document, I'd like to count for "array" field how many  
numbers are less than 200 and how many are greater than 500.

I tried this aggregation :

GET /test/values/\_search

```json
{
  "aggs" : {
    "less" : {
      "filter":{"range":{"array":{ "lt" : 200}}}
    },
    "greater" : {
       "filter":{"range":{"array":{ "gt" : 500}}}
    }
  }
}

```

But the 1st filter count the number of documents which have an array  
containing a value \<200 and the 2nd how many have a value \>500.  
What I'd like is to count how many values are \<200 and how many are \>500  
(not how many document).

If I make a sum / min / max aggregation, it will be on each value in arrays  
but not with a filter.  
Do you have an idea how to do that thing?

I did it with 2 script filters, it works, but the computing time is too bad  
:

```json
{ 
  "aggs" : {
    "less" : {
      "sum":{
        "script":" def sum = 0; doc['array'].values.each(){if(it < 200) 
sum++}; return sum;"}
    },
    "greater" : {
       "sum":{
         "script":"def sum = 0; doc['array'].values.each(){if(it > 500) 
sum++}; return sum;"}
    }
}

```

Any Idea?  
Thanks!

--  
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/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [October 7, 2014, 8:38am UTC](https://discuss.elastic.co/t/range-filter-aggregation-on-array/20104/2 "2014-10-07T08:38:33Z")

</div>

One of the solution I can think is by using nested documents for your array.  
In that case, each element of the array will be seen as the document.

Hope this helps

--  
David Pilato | Technical Advocate | [elasticsearch.com](http://elasticsearch.com)  
[david.pilato@elasticsearch.com](mailto:david.pilato@elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 7 octobre 2014 à 10:36:28, Rémi Nonnon ([remi.nonnon@gmail.com](mailto:remi.nonnon@gmail.com)) a écrit:

Hi all,

I have some troubles when I try to use Range Filter aggregation on an array.

Example of 1 document :

```json
{
   "_index": "test",
   "_type": "values",
   "_id": "1",
   "_version": 1,
   "found": true,
   "_source": {
      "array": [927,425,455,120]
    }
}

```

For all my "values" document, I'd like to count for "array" field how many numbers are less than 200 and how many are greater than 500.

I tried this aggregation :

GET /test/values/\_search

```json
{
  "aggs" : {
    "less" : {
      "filter":{"range":{"array":{ "lt" : 200}}}
    },
    "greater" : {
       "filter":{"range":{"array":{ "gt" : 500}}}
    }
  }
}

```

But the 1st filter count the number of documents which have an array containing a value \<200 and the 2nd how many have a value \>500.  
What I'd like is to count how many values are \<200 and how many are \>500 (not how many document).

If I make a sum / min / max aggregation, it will be on each value in arrays but not with a filter.  
Do you have an idea how to do that thing?

I did it with 2 script filters, it works, but the computing time is too bad :

```json
{ 
  "aggs" : {
    "less" : {
      "sum":{
        "script":" def sum = 0; doc['array'].values.each(){if(it < 200) sum++}; return sum;"}
    },
    "greater" : {
       "sum":{
         "script":"def sum = 0; doc['array'].values.each(){if(it > 500) sum++}; return sum;"}
    }
}

```

## Any Idea? Thanks!

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/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/etPan.5433a689.836c40e.7bd4%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.5433a689.836c40e.7bd4%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Remi\_Nonnon](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@Remi\_Nonnon](https://discuss.elastic.co/u/Remi_Nonnon)\
**Post date:** [October 7, 2014, 8:49am UTC](https://discuss.elastic.co/t/range-filter-aggregation-on-array/20104/3 "2014-10-07T08:49:50Z")

</div>

Hi,

Thanks for your immediate help!  
(sorry i deleted this post because I didn't find how to edit it. I posted a  
new one)

I did it with nested documents but the array seems to be faster on other  
aggregations like extended stats or percentiles then I wondered if my  
filters are well written.

Thanks again.

Le mardi 7 octobre 2014 10:38:43 UTC+2, David Pilato a écrit :

> One of the solution I can think is by using nested documents for your  
> array.  
> In that case, each element of the array will be seen as the document.
> 
> Hope this helps
> 
> --  
> _David Pilato_ | Technical Advocate | _[elasticsearch.com](http://elasticsearch.com)  
> [http://elasticsearch.com](http://elasticsearch.com)_  
> [david....@elasticsearch.com](mailto:david....@elasticsearch.com) \<javascript:\>  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> [http://twitter.com/scrutmydocs](http://twitter.com/scrutmydocs)  
> [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 7 octobre 2014 à 10:36:28, Rémi Nonnon ([remi....@gmail.com](mailto:remi....@gmail.com)  
> \<javascript:\>) a écrit:
> 
> Hi all,
> 
> I have some troubles when I try to use Range Filter aggregation on an  
> array.
> 
> Example of 1 document :
> 
> ```json
> {
> "_index": "test",
> "_type": "values",
> "_id": "1",
> "_version": 1,
> "found": true,
> "_source": {
> "array": [927,425,455,120]
> }
> }
> 
> ```
> 
> For all my "values" document, I'd like to count for "array" field how many  
> numbers are less than 200 and how many are greater than 500.
> 
> I tried this aggregation :
> 
> GET /test/values/\_search
> 
> ```json
> {
> "aggs" : {
> "less" : {
> "filter":{"range":{"array":{ "lt" : 200}}}
> },
> "greater" : {
> "filter":{"range":{"array":{ "gt" : 500}}}
> }
> }
> }
> 
> ```
> 
> But the 1st filter count the number of documents which have an array  
> containing a value \<200 and the 2nd how many have a value \>500.  
> What I'd like is to count how many values are \<200 and how many are \>500  
> (not how many document).
> 
> If I make a sum / min / max aggregation, it will be on each value in  
> arrays but not with a filter.  
> Do you have an idea how to do that thing?
> 
> I did it with 2 script filters, it works, but the computing time is too  
> bad :
> 
> ```json
> { 
> "aggs" : {
> "less" : {
> "sum":{
> "script":" def sum = 0; doc['array'].values.each(){if(it < 200) 
> sum++}; return sum;"}
> },
> "greater" : {
> "sum":{
> "script":"def sum = 0; doc['array'].values.each(){if(it > 500) 
> sum++}; return sum;"}
> }
> }
> 
> ```
> 
> ## Any Idea? Thanks!
> 
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/ea6b7b2e-2874-4387-b314-86a425e88b77%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ea6b7b2e-2874-4387-b314-86a425e88b77%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [October 7, 2014, 9:38am UTC](https://discuss.elastic.co/t/range-filter-aggregation-on-array/20104/4 "2014-10-07T09:38:10Z")

</div>

I have no idea. It's hard to understand what you exactly did without a full reproduction.  
A SENSE script posted as a GIST would help a lot I think.

--  
David Pilato | Technical Advocate | [elasticsearch.com](http://elasticsearch.com)  
[david.pilato@elasticsearch.com](mailto:david.pilato@elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 7 octobre 2014 à 10:49:54, Rémi Nonnon ([remi.nonnon@gmail.com](mailto:remi.nonnon@gmail.com)) a écrit:

Hi,

Thanks for your immediate help!  
(sorry i deleted this post because I didn't find how to edit it. I posted a new one)

I did it with nested documents but the array seems to be faster on other aggregations like extended stats or percentiles then I wondered if my filters are well written.

Thanks again.

Le mardi 7 octobre 2014 10:38:43 UTC+2, David Pilato a écrit :  
One of the solution I can think is by using nested documents for your array.  
In that case, each element of the array will be seen as the document.

Hope this helps

--  
David Pilato | Technical Advocate | [elasticsearch.com](http://elasticsearch.com)  
[david....@elasticsearch.com](mailto:david....@elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 7 octobre 2014 à 10:36:28, Rémi Nonnon ([remi....@gmail.com](mailto:remi....@gmail.com)) a écrit:

Hi all,

I have some troubles when I try to use Range Filter aggregation on an array.

Example of 1 document :

```json
{
   "_index": "test",
   "_type": "values",
   "_id": "1",
   "_version": 1,
   "found": true,
   "_source": {
      "array": [927,425,455,120]
    }
}

```

For all my "values" document, I'd like to count for "array" field how many numbers are less than 200 and how many are greater than 500.

I tried this aggregation :

GET /test/values/\_search

```json
{
  "aggs" : {
    "less" : {
      "filter":{"range":{"array":{ "lt" : 200}}}
    },
    "greater" : {
       "filter":{"range":{"array":{ "gt" : 500}}}
    }
  }
}

```

But the 1st filter count the number of documents which have an array containing a value \<200 and the 2nd how many have a value \>500.  
What I'd like is to count how many values are \<200 and how many are \>500 (not how many document).

If I make a sum / min / max aggregation, it will be on each value in arrays but not with a filter.  
Do you have an idea how to do that thing?

I did it with 2 script filters, it works, but the computing time is too bad :

```json
{ 
  "aggs" : {
    "less" : {
      "sum":{
        "script":" def sum = 0; doc['array'].values.each(){if(it < 200) sum++}; return sum;"}
    },
    "greater" : {
       "sum":{
         "script":"def sum = 0; doc['array'].values.each(){if(it > 500) sum++}; return sum;"}
    }
}

```

## Any Idea? Thanks!

## 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com). For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

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/ea6b7b2e-2874-4387-b314-86a425e88b77%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ea6b7b2e-2874-4387-b314-86a425e88b77%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/etPan.5433b483.614fd4a1.7bd4%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.5433b483.614fd4a1.7bd4%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Remi\_Nonnon](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@Remi\_Nonnon](https://discuss.elastic.co/u/Remi_Nonnon)\
**Post date:** [October 8, 2014, 2:33pm UTC](https://discuss.elastic.co/t/range-filter-aggregation-on-array/20104/5 "2014-10-08T14:33:22Z")

</div>

Hi,

It's ok, I think you are right, nested will be the solution.

Regards,  
Rémi.

Le mardi 7 octobre 2014 11:38:44 UTC+2, David Pilato a écrit :

> I have no idea. It's hard to understand what you exactly did without a  
> full reproduction.  
> A SENSE script posted as a GIST would help a lot I think.
> 
> --  
> _David Pilato_ | Technical Advocate | _[elasticsearch.com](http://elasticsearch.com)  
> [http://elasticsearch.com](http://elasticsearch.com)_  
> [david....@elasticsearch.com](mailto:david....@elasticsearch.com) \<javascript:\>  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> [http://twitter.com/scrutmydocs](http://twitter.com/scrutmydocs)  
> [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 7 octobre 2014 à 10:49:54, Rémi Nonnon ([remi....@gmail.com](mailto:remi....@gmail.com)  
> \<javascript:\>) a écrit:
> 
> Hi,
> 
> Thanks for your immediate help!  
> (sorry i deleted this post because I didn't find how to edit it. I posted  
> a new one)
> 
> I did it with nested documents but the array seems to be faster on other  
> aggregations like extended stats or percentiles then I wondered if my  
> filters are well written.
> 
> Thanks again.
> 
> Le mardi 7 octobre 2014 10:38:43 UTC+2, David Pilato a écrit :
> 
> > One of the solution I can think is by using nested documents for your  
> > array.  
> > In that case, each element of the array will be seen as the document.
> > 
> > Hope this helps
> > 
> > --
> > 
> > - David Pilato\* | Technical Advocate | _[elasticsearch.com](http://elasticsearch.com)  
> > [http://elasticsearch.com](http://elasticsearch.com)_  
> > [david....@elasticsearch.com](mailto:david....@elasticsearch.com)  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> > [http://twitter.com/scrutmydocs](http://twitter.com/scrutmydocs)  
> > [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 7 octobre 2014 à 10:36:28, Rémi Nonnon ([remi....@gmail.com](mailto:remi....@gmail.com)) a écrit:
> > 
> > Hi all,
> > 
> > I have some troubles when I try to use Range Filter aggregation on an  
> > array.
> > 
> > Example of 1 document :
> > 
> > ```json
> > {
> > "_index": "test",
> > "_type": "values",
> > "_id": "1",
> > "_version": 1,
> > "found": true,
> > "_source": {
> > "array": [927,425,455,120]
> > }
> > }
> > 
> > ```
> > 
> > For all my "values" document, I'd like to count for "array" field how  
> > many numbers are less than 200 and how many are greater than 500.
> > 
> > I tried this aggregation :
> > 
> > GET /test/values/\_search
> > 
> > ```json
> > {
> > "aggs" : {
> > "less" : {
> > "filter":{"range":{"array":{ "lt" : 200}}}
> > },
> > "greater" : {
> > "filter":{"range":{"array":{ "gt" : 500}}}
> > }
> > }
> > }
> > 
> > ```
> > 
> > But the 1st filter count the number of documents which have an array  
> > containing a value \<200 and the 2nd how many have a value \>500.  
> > What I'd like is to count how many values are \<200 and how many are \>500  
> > (not how many document).
> > 
> > If I make a sum / min / max aggregation, it will be on each value in  
> > arrays but not with a filter.  
> > Do you have an idea how to do that thing?
> > 
> > I did it with 2 script filters, it works, but the computing time is too  
> > bad :
> > 
> > ```json
> > { 
> > "aggs" : {
> > "less" : {
> > "sum":{
> > "script":" def sum = 0; doc['array'].values.each(){if(it < 200) 
> > sum++}; return sum;"}
> > },
> > "greater" : {
> > "sum":{
> > "script":"def sum = 0; doc['array'].values.each(){if(it > 500) 
> > sum++}; return sum;"}
> > }
> > }
> > 
> > ```
> > 
> > ## Any Idea? Thanks!
> > 
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d988da81-167f-48d2-b4c8-8e94956bc333%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/ea6b7b2e-2874-4387-b314-86a425e88b77%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ea6b7b2e-2874-4387-b314-86a425e88b77%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/ea6b7b2e-2874-4387-b314-86a425e88b77%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/ea6b7b2e-2874-4387-b314-86a425e88b77%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/534e9e53-32af-4660-b56c-e63c01006b21%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/534e9e53-32af-4660-b56c-e63c01006b21%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:57am UTC](https://discuss.elastic.co/t/range-filter-aggregation-on-array/20104/6 "2017-07-06T00:57:37Z")

</div>


