# How to Find the size of nested field/ array?

**URL:** https://discuss.elastic.co/t/how-to-find-the-size-of-nested-field-array/178734
**Category:** Elasticsearch
**Created:** [April 27, 2019, 2:57am UTC](https://discuss.elastic.co/t/how-to-find-the-size-of-nested-field-array/178734 "2019-04-27T02:57:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rssapra7](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@rssapra7](https://discuss.elastic.co/u/rssapra7)
#### Post date: [April 27, 2019, 2:57am UTC](https://discuss.elastic.co/t/how-to-find-the-size-of-nested-field-array/178734/1 "2019-04-27T02:57:04Z")

</div>

Structure looks like this :

> {  
> "heads": {  
> "mappings": {  
> "head": {  
> "dynamic": "false",  
> "properties": {  
> "nestedField1": {  
> "type": "nested",  
> "properties": {  
> "nestedField2": {  
> "type": "nested",  
> "properties": {  
> "field1": {  
> "type": "keyword"  
> },  
> "field2": {  
> "type": "keyword"  
> }  
> }  
> },  
> "field3": {  
> "type": "keyword"  
> },  
> "field4": {  
> "type": "keyword"  
> },  
> "field5": {  
> "type": "keyword"  
> }  
> }  
> }  
> }  
> }  
> }  
> }  
> }  
> What I want is to filter by the size of nestedField2...

Please share the exact query, if possible.  
Thanks in advance!

---

<div class="post-metadata">

### Author: ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)
#### Post date: [April 29, 2019, 12:48pm UTC](https://discuss.elastic.co/t/how-to-find-the-size-of-nested-field-array/178734/2 "2019-04-29T12:48:03Z")

</div>

Moved this to the Elasticsearch forum so you will get a better answer.

---

<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: [May 27, 2019, 12:48pm UTC](https://discuss.elastic.co/t/how-to-find-the-size-of-nested-field-array/178734/3 "2019-05-27T12:48:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
