# Get last indexed document id

**URL:** https://discuss.elastic.co/t/get-last-indexed-document-id/12699
**Category:** Elasticsearch
**Created:** [July 8, 2013, 11:25am UTC](https://discuss.elastic.co/t/get-last-indexed-document-id/12699 "2013-07-08T11:25:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ophir\_Michaeli](https://avatars.discourse-cdn.com/v4/letter/o/9f8e36/32.png) [@Ophir\_Michaeli](https://discuss.elastic.co/u/Ophir_Michaeli)
#### Post date: [July 8, 2013, 11:25am UTC](https://discuss.elastic.co/t/get-last-indexed-document-id/12699/1 "2013-07-08T11:25:51Z")

</div>

Hi,

I have a scenario in which elasticsearch indexing might stop and I need to  
continue from that point, so I need to query elasticsearch for the last  
indexed document id.

Thanks

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)
#### Post date: [July 8, 2013, 12:54pm UTC](https://discuss.elastic.co/t/get-last-indexed-document-id/12699/2 "2013-07-08T12:54:36Z")

</div>

Hi Ophir,

You could use the timestamp  
field[http://www.elasticsearch.org/guide/reference/mapping/timestamp-field/](http://www.elasticsearch.org/guide/reference/mapping/timestamp-field/)and  
do a query, sorting on timestamp descending.

Best regards,  
Radu

On Mon, Jul 8, 2013 at 2:25 PM, Ophir Michaeli [ophirmichaeli@gmail.com](mailto:ophirmichaeli@gmail.com)wrote:

> Hi,\*\*\*\*\*\*
> 
> * * *
> 
> I have a scenario in which elasticsearch indexing might stop and I need to  
> continue from that point, so I need to query elasticsearch for the last  
> indexed document id.\*\*\*\*
> 
> * * *
> 
> Thanks\*\*\*\*
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:27am UTC](https://discuss.elastic.co/t/get-last-indexed-document-id/12699/3 "2017-07-06T02:27:37Z")

</div>


