# How to check the total amount of data stored in a particular type

**URL:** https://discuss.elastic.co/t/how-to-check-the-total-amount-of-data-stored-in-a-particular-type/38109
**Category:** Elasticsearch
**Created:** [December 29, 2015, 1:35pm UTC](https://discuss.elastic.co/t/how-to-check-the-total-amount-of-data-stored-in-a-particular-type/38109 "2015-12-29T13:35:15Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![justnj](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@justnj](https://discuss.elastic.co/u/justnj)
#### Post date: [December 29, 2015, 1:35pm UTC](https://discuss.elastic.co/t/how-to-check-the-total-amount-of-data-stored-in-a-particular-type/38109/1 "2015-12-29T13:35:16Z")

</div>

How to check the total amount of data stored in a particular type.  
I have different types and want to check the growth of the data in each type

current size and want to predict the growth

---

<div class="post-metadata">

### Author: ![jimczi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jimczi/32/47985_2.png) [@jimczi](https://discuss.elastic.co/u/jimczi)
#### Post date: [December 29, 2015, 5:42pm UTC](https://discuss.elastic.co/t/how-to-check-the-total-amount-of-data-stored-in-a-particular-type/38109/2 "2015-12-29T17:42:13Z")

</div>

If by "total amount of data" you mean the number of documents per type then you have multiple options. You can run a match\_all query for each type using the count API:

```
curl -XGET 'http://localhost:9200/twitter/tweet/_count' -d '
{ "match_all": {} }'

```

Or you can use a term aggregation on the \_type field to get the number of documents per type in one query:

```
{
    "aggs" : {
        "per_type" : {
            "terms" : { "field" : "_type" }
        }
    }
}
```

---

<div class="post-metadata">

### Author: ![justnj](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@justnj](https://discuss.elastic.co/u/justnj)
#### Post date: [December 30, 2015, 5:03am UTC](https://discuss.elastic.co/t/how-to-check-the-total-amount-of-data-stored-in-a-particular-type/38109/3 "2015-12-30T05:03:20Z")

</div>

I want to check the size of a type in mb or gb ...

---

<div class="post-metadata">

### Author: ![justnj](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@justnj](https://discuss.elastic.co/u/justnj)
#### Post date: [December 30, 2015, 5:09am UTC](https://discuss.elastic.co/t/how-to-check-the-total-amount-of-data-stored-in-a-particular-type/38109/4 "2015-12-30T05:09:34Z")

</div>

bank  
size: 470ki (940ki) -------------------this is the size of the bank index,wil have more types ... i want to know the size of each type  
docs: 1,000 (2,000)

---

<div class="post-metadata">

### Author: ![jimczi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jimczi/32/47985_2.png) [@jimczi](https://discuss.elastic.co/u/jimczi)
#### Post date: [December 30, 2015, 5:09pm UTC](https://discuss.elastic.co/t/how-to-check-the-total-amount-of-data-stored-in-a-particular-type/38109/5 "2015-12-30T17:09:42Z")

</div>

The types are shared in a single index thus it is not possible to get the size that each type takes on disk. The type is just an abstraction inside the index that is materialized by a single field named \_type. Everything is interleaved inside the index, some fields are shared among the types so the size of each type is hardly computable. You can read this post for further information: [https://www.elastic.co/blog/index-vs-type](https://www.elastic.co/blog/index-vs-type)

---

<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 5, 2017, 11:27pm UTC](https://discuss.elastic.co/t/how-to-check-the-total-amount-of-data-stored-in-a-particular-type/38109/6 "2017-07-05T23:27:48Z")

</div>


