# Query document size

**URL:** <https://discuss.elastic.co/t/query-document-size/21184>\
**Category:** Elasticsearch\
**Created:** [December 10, 2014, 11:02am UTC](https://discuss.elastic.co/t/query-document-size/21184 "2014-12-10T11:02:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jojo\_Juju](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@Jojo\_Juju](https://discuss.elastic.co/u/Jojo_Juju)\
**Post date:** [December 10, 2014, 11:02am UTC](https://discuss.elastic.co/t/query-document-size/21184/1 "2014-12-10T11:02:17Z")

</div>

Hi,

I'm fairly new to ES and I wonder if there is a way to query size (in  
bytes) of a single document, not average.

There was similar post  
[https://groups.google.com/d/msg/elasticsearch/N83Q-K\_jK34/gYmbQSRn82kJ](https://groups.google.com/d/msg/elasticsearch/N83Q-K_jK34/gYmbQSRn82kJ)

which was was not answered. Did anyone ever encountered need for that and  
possibly help how can I do it?

Ta

--  
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/7ea54254-581f-444d-b07d-c63cd31232d5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7ea54254-581f-444d-b07d-c63cd31232d5%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [December 10, 2014, 12:27pm UTC](https://discuss.elastic.co/t/query-document-size/21184/2 "2014-12-10T12:27:23Z")

</div>

What are you looking to measure? The indexes don't really have a per  
document size because they, well, are indexes. The documents do taken up  
some space on disk but they are compressed.  
On Dec 10, 2014 6:02 AM, "Jojo Juju" [tv.in.concur@gmail.com](mailto:tv.in.concur@gmail.com) wrote:

> Hi,
> 
> I'm fairly new to ES and I wonder if there is a way to query size (in  
> bytes) of a single document, not average.
> 
> There was similar post  
> [https://groups.google.com/d/msg/elasticsearch/N83Q-K\_jK34/gYmbQSRn82kJ](https://groups.google.com/d/msg/elasticsearch/N83Q-K_jK34/gYmbQSRn82kJ)
> 
> which was was not answered. Did anyone ever encountered need for that and  
> possibly help how can I do it?
> 
> Ta
> 
> --  
> 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/7ea54254-581f-444d-b07d-c63cd31232d5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7ea54254-581f-444d-b07d-c63cd31232d5%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/7ea54254-581f-444d-b07d-c63cd31232d5%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7ea54254-581f-444d-b07d-c63cd31232d5%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/CAPmjWd20keJ3RSZ\_0r1AKZ80nBbWBt%3DDQ-qKYT%3DCj-SJZqF47g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd20keJ3RSZ_0r1AKZ80nBbWBt%3DDQ-qKYT%3DCj-SJZqF47g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jojo\_Juju](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@Jojo\_Juju](https://discuss.elastic.co/u/Jojo_Juju)\
**Post date:** [December 10, 2014, 12:58pm UTC](https://discuss.elastic.co/t/query-document-size/21184/3 "2014-12-10T12:58:11Z")

</div>

Compressed size of a document on disk would be enough. We use store level  
compression not the per document.  
Would this be then actually possible?

Thanks

On Wednesday, December 10, 2014 1:27:49 PM UTC+1, Nikolas Everett wrote:

> What are you looking to measure? The indexes don't really have a per  
> document size because they, well, are indexes. The documents do taken up  
> some space on disk but they are compressed.  
> On Dec 10, 2014 6:02 AM, "Jojo Juju" \<[tv.in....@gmail.com](mailto:tv.in....@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > Hi,
> > 
> > I'm fairly new to ES and I wonder if there is a way to query size (in  
> > bytes) of a single document, not average.
> > 
> > There was similar post  
> > [https://groups.google.com/d/msg/elasticsearch/N83Q-K\_jK34/gYmbQSRn82kJ](https://groups.google.com/d/msg/elasticsearch/N83Q-K_jK34/gYmbQSRn82kJ)
> > 
> > which was was not answered. Did anyone ever encountered need for that and  
> > possibly help how can I do it?
> > 
> > Ta
> > 
> > --  
> > 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/7ea54254-581f-444d-b07d-c63cd31232d5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7ea54254-581f-444d-b07d-c63cd31232d5%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/7ea54254-581f-444d-b07d-c63cd31232d5%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7ea54254-581f-444d-b07d-c63cd31232d5%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/6f7d85d3-ab7a-4caa-87d5-5ba42ba7cdfb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6f7d85d3-ab7a-4caa-87d5-5ba42ba7cdfb%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [December 10, 2014, 1:26pm UTC](https://discuss.elastic.co/t/query-document-size/21184/4 "2014-12-10T13:26:34Z")

</div>

In that case you can just count the bytes in the \_source field. As I said  
before just adding those up won't give you all the space taken up by the  
whole shard but it'll give you some idea of how much space Lucene uses.

Nik

On Wed, Dec 10, 2014 at 7:58 AM, Jojo Juju [tv.in.concur@gmail.com](mailto:tv.in.concur@gmail.com) wrote:

> Compressed size of a document on disk would be enough. We use store level  
> compression not the per document.  
> Would this be then actually possible?
> 
> Thanks
> 
> On Wednesday, December 10, 2014 1:27:49 PM UTC+1, Nikolas Everett wrote:
> 
> > What are you looking to measure? The indexes don't really have a per  
> > document size because they, well, are indexes. The documents do taken up  
> > some space on disk but they are compressed.  
> > On Dec 10, 2014 6:02 AM, "Jojo Juju" [tv.in....@gmail.com](mailto:tv.in....@gmail.com) wrote:
> > 
> > > Hi,
> > > 
> > > I'm fairly new to ES and I wonder if there is a way to query size (in  
> > > bytes) of a single document, not average.
> > > 
> > > There was similar post [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msg/elasticsearch/N83Q-K\_jK34/gYmbQSRn82kJ
> > > 
> > > which was was not answered. Did anyone ever encountered need for that  
> > > and possibly help how can I do it?
> > > 
> > > Ta
> > > 
> > > --  
> > > 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/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/7ea54254-581f-444d-b07d-c63cd31232d5%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/7ea54254-581f-444d-b07d-c63cd31232d5%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7ea54254-581f-444d-b07d-c63cd31232d5%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/6f7d85d3-ab7a-4caa-87d5-5ba42ba7cdfb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6f7d85d3-ab7a-4caa-87d5-5ba42ba7cdfb%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/6f7d85d3-ab7a-4caa-87d5-5ba42ba7cdfb%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6f7d85d3-ab7a-4caa-87d5-5ba42ba7cdfb%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/CAPmjWd0BdviWHcJVvXKQKEm38DD3jO44cKEVx9Wc5HN\_X5R8ag%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0BdviWHcJVvXKQKEm38DD3jO44cKEVx9Wc5HN_X5R8ag%40mail.gmail.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:44am UTC](https://discuss.elastic.co/t/query-document-size/21184/5 "2017-07-06T00:44:29Z")

</div>


