# Count number of objects nested field

**URL:** https://discuss.elastic.co/t/count-number-of-objects-nested-field/120658
**Category:** Elasticsearch
**Created:** [February 20, 2018, 2:06pm UTC](https://discuss.elastic.co/t/count-number-of-objects-nested-field/120658 "2018-02-20T14:06:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Subair\_K\_B](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@Subair\_K\_B](https://discuss.elastic.co/u/Subair_K_B)
#### Post date: [February 20, 2018, 2:06pm UTC](https://discuss.elastic.co/t/count-number-of-objects-nested-field/120658/1 "2018-02-20T14:06:23Z")

</div>

How to count number of objects in a nested filed in elastic search?

Sample mapping :

"keywords": {  
"type": "nested",  
"properties": {  
"base": {  
"type": "text"  
},  
"category": {  
"type": "text"  
} }  
}  
I would like to count number of objects in nested filed 'keywords'.

---

<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: [March 20, 2018, 2:07pm UTC](https://discuss.elastic.co/t/count-number-of-objects-nested-field/120658/2 "2018-03-20T14:07:24Z")

</div>

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