Deleting documents vs deleting the whole index and rebuilding it periodically

So that will be fine IMO.

the problem is I would always have to search the two most recent indices.

Even though you are probably not going to implement that, let me add some comments.
Not really an issue. Just use an alias anytime you create a monthly index.

mydata -> index-2018-04
mydata -> index-2018-05

Then you just have to search on mydata in your application. Elasticsearch will run the search on all indices.

Then if you delete the index-2018-04, it won't be searched anymore.

Anyway, you are not going to use that probably. :slight_smile:

2 Likes