Can I snapshot only a couple types within my index?

I have an index called "index1". Within index1, I have multiple types "type1", "type2", "type3".

Is there a way to snapshot the index and only "type1" and "type3" and do not snapshot "type2" of the index?

My use case here is, I do not want to snapshot or save off any of the data in my index's "type2" type.

The documentation here: https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html helped me to create a snapshot of all of my indices. But with the amount of disk space I have available for snapshots. I found that there are a couple TYPES I don't need to worry about capturing in a snapshot and would prefer not to save them.

Any insight would be greatly appreciated

Not with just the Snapshot functionality, no. It only knows how to backup entire indices, not individual types. The Snapshot functionality works by backing up Lucene segments, which are chunks of data that make up the index. Each segment contains multiple documents.

The reason types can't be split out is because under the covers, types are just fields on the document. So all the types are mixed up inside a single segment, meaning there isn't a single data structure to split out and backup.

You could theoretically use the Reindex API to reindex the individual types you care about into a dedicated, new index. Then Snapshot that newly created index. That does mean, however, that you have to perform that reindexing operation which may expensive/time consuming depending on how much data you have.

1 Like

Thanks for the quick reply and insight.