karmi/tire — pull request #163 by dylanahsmith (2011-12-08 19:20:34+00:00)
Title: Make it easier to re-perform a failed search on another server.

Currently the url to make the search request to is set in the Search initializer. This makes retrying a search without rebuilding the whole search not simple. This change allows the following to work:

search = Tire::Search::Search.new('articles')
# build search ...
servers = ["http://localhost:9200", "http://localhost:9201"]
begin
Tire::Configuration.url = servers[0]
search.perform
rescue Errno::ECONNREFUSED => e
Tire::Configuration.url = servers[1]
search.perform
end
# do something with results ...