karmi/tire — pull request #420 by mriley (2012-07-31 01:05:45+00:00)
Title: Fix for Tire::Alias interface corrupting alias attributes when routing values are associated with the Alias

This is a small change to the way Tire picks out the "indices" attribute passed to the Alias initializer. The original regex match only works if an existing Alias doesn't have a routing value associated with it. If a routing value is set, ElasticSearch returns a key called "index_routing", which can overwrite the "indices" or "index" value if it comes later in the hash iteration, since that key also matches the regex "/index|indices/".

This problem appeared to us when using Tire::Alias.find() to find the indices associated with a particular alias. We were finding the alias correctly, but the list of indices returned with the Alias object was always incorrect — it was set to the value returned as "index_routing" instead.

Let me know if you need more details for reproduction.