# Deleting time based document -dummy

**URL:** <https://discuss.elastic.co/t/deleting-time-based-document-dummy/44971>\
**Category:** Elasticsearch\
**Created:** [March 21, 2016, 10:20am UTC](https://discuss.elastic.co/t/deleting-time-based-document-dummy/44971 "2016-03-21T10:20:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lknls](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lknls/32/7930_2.png) [@lknls](https://discuss.elastic.co/u/lknls)\
**Post date:** [March 21, 2016, 10:20am UTC](https://discuss.elastic.co/t/deleting-time-based-document-dummy/44971/1 "2016-03-21T10:20:29Z")

</div>

Hello;

I want to delete my document by date. I read [https://www.elastic.co/guide/en/elasticsearch/client/curator/current/examples.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/examples.html) . It's deleting about the INDEX, not the document

Lets assume that my index name is **X** and i've many documents like **Y1,Y2,....,Y1000000 (ten million)**

If i want to delete some of **Y** , Elasticsearch suggest me to delete the **X** and it's logs for **Y**?

I'm so sorry for those stupid questions

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 21, 2016, 10:53am UTC](https://discuss.elastic.co/t/deleting-time-based-document-dummy/44971/2 "2016-03-21T10:53:22Z")

</div>

When managing retention of documents, the recommended approach is often to use [time based indices](https://www.elastic.co/guide/en/elasticsearch/guide/master/time-based.html) instead of large indices from which data periodically need to be deleted. This works particularly well for immutable data, this is the use case for which Curator was designed.

What type of data do you have? What is your use case?

---

<div class="post-metadata">

**Author:** ![lknls](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lknls/32/7930_2.png) [@lknls](https://discuss.elastic.co/u/lknls)\
**Post date:** [March 21, 2016, 11:56am UTC](https://discuss.elastic.co/t/deleting-time-based-document-dummy/44971/3 "2016-03-21T11:56:54Z")

</div>

Hello Christian

My fields mappings are below. I was planning to use one big indice before your reply

{  
"ContentMessage":{  
"type":"string"  
},  
"ParentID":{  
"index":"not\_analyzed",  
"type":"string"  
},  
"date":{  
"format":"strict\_date\_optional\_time||epoch\_millis",  
"type":"date"  
},  
"DocumentID":{  
"type":"long"  
},  
"DataContent":{  
"type":"string"  
}  
}

Is it possible to you to give an example how create a time based indices for last 10 days?

Thanks for your help

---

<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:** [March 21, 2016, 12:12pm UTC](https://discuss.elastic.co/t/deleting-time-based-document-dummy/44971/4 "2016-03-21T12:12:53Z")

</div>

Usually you use a tool like curator to create a new index every day and do  
some tidying up on the old indexes. It is usually handled by making an  
alias that points to the "current" index and always moving it to the next  
day's index when you create a new one. Or maybe you create one weekly. Or  
something like that.

---

<div class="post-metadata">

**Author:** ![lknls](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lknls/32/7930_2.png) [@lknls](https://discuss.elastic.co/u/lknls)\
**Post date:** [March 21, 2016, 1:25pm UTC](https://discuss.elastic.co/t/deleting-time-based-document-dummy/44971/5 "2016-03-21T13:25:03Z")

</div>

hello Nik

Thank you for your answers but is there a document about how to this?

or can you provide a sample for this?

thank you for your continues help 🙂

---

<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:06pm UTC](https://discuss.elastic.co/t/deleting-time-based-document-dummy/44971/6 "2017-07-05T23:06:37Z")

</div>


