Deleting time based document -dummy


#1

Hello;

I want to delete my document by date. I read 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


(Christian Dahlqvist) #2

When managing retention of documents, the recommended approach is often to use time based indices 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?


#3

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


(Nik Everett) #4

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.


#5

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 :slight_smile:


(system) #6