# How to get all document \_id of an elasticsearch index

**URL:** <https://discuss.elastic.co/t/how-to-get-all-document--id-of-an-elasticsearch-index/19518>\
**Category:** Elasticsearch\
**Created:** [August 28, 2014, 7:52pm UTC](https://discuss.elastic.co/t/how-to-get-all-document--id-of-an-elasticsearch-index/19518 "2014-08-28T19:52:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shenwno](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@shenwno](https://discuss.elastic.co/u/shenwno)\
**Post date:** [August 28, 2014, 7:52pm UTC](https://discuss.elastic.co/t/how-to-get-all-document--id-of-an-elasticsearch-index/19518/1 "2014-08-28T19:52:05Z")

</div>

Hi all,

I'm trying to figure out a way to retrieve all the document '\_id' (ES  
internal \_id) from an index, e.g. the index has about 20 million documents.  
However, by using the get api, ES will do a paging and only return part of  
the data.  
Not sure if the bulk api could handle this task, but with the scale of the  
index, it's still a heavy query.  
Is there anyway I can retrieve against the raw filesystem?

Thanks for helping  
Wei

--  
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/b22e2015-f8cc-408a-857a-14a4fbbcf6a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b22e2015-f8cc-408a-857a-14a4fbbcf6a0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)\
**Post date:** [August 29, 2014, 1:53am UTC](https://discuss.elastic.co/t/how-to-get-all-document--id-of-an-elasticsearch-index/19518/2 "2014-08-29T01:53:58Z")

</div>

Hello Wei ,

You can scan through all the documents in ES using scan and scroll -

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Thanks  
Vineeth

On Fri, Aug 29, 2014 at 1:22 AM, Wei Shen [shenwno@gmail.com](mailto:shenwno@gmail.com) wrote:

> Hi all,
> 
> I'm trying to figure out a way to retrieve all the document '\_id' (ES  
> internal \_id) from an index, e.g. the index has about 20 million  
> documents.  
> However, by using the get api, ES will do a paging and only return part of  
> the data.  
> Not sure if the bulk api could handle this task, but with the scale of the  
> index, it's still a heavy query.  
> Is there anyway I can retrieve against the raw filesystem?
> 
> Thanks for helping  
> Wei
> 
> --  
> 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/b22e2015-f8cc-408a-857a-14a4fbbcf6a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b22e2015-f8cc-408a-857a-14a4fbbcf6a0%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/b22e2015-f8cc-408a-857a-14a4fbbcf6a0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b22e2015-f8cc-408a-857a-14a4fbbcf6a0%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/CAGdPd5mYcG8AjCY2gRiRXkmmNByAHK2pJv\_ajwOuofyP8c4zgQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5mYcG8AjCY2gRiRXkmmNByAHK2pJv_ajwOuofyP8c4zgQ%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, 1:05am UTC](https://discuss.elastic.co/t/how-to-get-all-document--id-of-an-elasticsearch-index/19518/3 "2017-07-06T01:05:33Z")

</div>


