# Size of document

**URL:** <https://discuss.elastic.co/t/size-of-document/37582>\
**Category:** Elasticsearch\
**Created:** [December 18, 2015, 2:41pm UTC](https://discuss.elastic.co/t/size-of-document/37582 "2015-12-18T14:41:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan\_Andres\_Ramirez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juan_andres_ramirez/32/9467_2.png) [@Juan\_Andres\_Ramirez](https://discuss.elastic.co/u/Juan_Andres_Ramirez)\
**Post date:** [December 18, 2015, 2:41pm UTC](https://discuss.elastic.co/t/size-of-document/37582/1 "2015-12-18T14:41:56Z")

</div>

Hello Guys,  
I have an index and I need get size data of specifyc source, and I executed the following query:

```
curl -XGET http://localhost:9200/graylog2_62/_search?pretty -d '{
"query": {
"query_string": {"default_field":"source","query": "CVIADDBA08"}}}'
{

```

Response:

```
 "took" : 767,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
      "hits" : {
"total" : 43194300,
"max_score" : 1.8460549,
"hits" : [ {
  "_index" : "graylog2_62",
  "_type" : "message",
  "_id" : "38db1ca5-a49e-11e5-bc77-005056a9199b",
  "_score" : 1.8460549,
      "_source":{.......etc.....

```

The field "total" : 43194300, is the size of data in bytes?.

Thank you.

---

<div class="post-metadata">

**Author:** ![rusty](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@rusty](https://discuss.elastic.co/u/rusty)\
**Post date:** [December 18, 2015, 3:01pm UTC](https://discuss.elastic.co/t/size-of-document/37582/2 "2015-12-18T15:01:54Z")

</div>

Hi. It's number of matched documents. It looks like a total documents count in index, because you should use `-XPOST` instead of `-XGET`.

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [December 18, 2015, 4:51pm UTC](https://discuss.elastic.co/t/size-of-document/37582/3 "2015-12-18T16:51:53Z")

</div>

"total" holds the total number of documents that match the query, not the size in bytes. I am not aware of a straightforward way to get the size in bytes of all the results for a specific query, unless you are willing to scroll over all your results.

If you want to know how much an index takes though you can have a look at the indices stats api, but that is for the whole index, not only for documents that match a specific query. [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html)

---

<div class="post-metadata">

**Author:** ![Juan\_Andres\_Ramirez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juan_andres_ramirez/32/9467_2.png) [@Juan\_Andres\_Ramirez](https://discuss.elastic.co/u/Juan_Andres_Ramirez)\
**Post date:** [January 5, 2016, 2:18pm UTC](https://discuss.elastic.co/t/size-of-document/37582/4 "2016-01-05T14:18:49Z")

</div>

Thank you so much for your answerded.  
Problem solved with indices stats.

---

<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:26pm UTC](https://discuss.elastic.co/t/size-of-document/37582/5 "2017-07-05T23:26:57Z")

</div>


