Aliasing a real index pattern

lets say I have an actual, real index pattern foo-*. then i create another real index pattern v2-foo-*. now i create an alias that looks something like this:
{ "actions": [ { "add": { "index": "v2-foo-*", "alias": "foo-*" } } ] }

Lets just say that the pattern invoked by -* is simply a pattern for the date (eg, 2015.12.04).
So say I have these two sets of indexes:


Now, I want to be able to delete all of the old foo-* indices. Is there anyway of doing this, other than having to reference each one of them individually?

Is the alias creation request accepted by elasticsearch ?

Sorry, I didn't write the question out properly. I have since edited. thanks

curl -XDELETE 'localhost:9200/foo-*' should do it though I tend to not use wildcards in deletes because I fear mistyping things. I suggest full paranoia: test it locally before you run it on real stuff. Make sure it only deletes what you want and then copy the command where you want to run it.

think there might be confusion here. as I have pointed out, foo-* is aliased to v2-foo-*.. so running DELETE foo-* deletes all v2-foo-* indices. I just tested it.

@dadoonet, I dunno if its ok that we resolve the DELETEs through the aliases. That seems a bit too much.

@treehouse, I'd just delete each index individually. I'd pretty much do that all the time anyway, but I'd certainly do that given when you've mentioned here.

yep makes sense, thanks for the tip.