sunspot/sunspot — pull request #168 by robdimarco (2012-01-18 01:22:20+00:00)
Title: Patch to allow for sending timeout (issue #154)

Issue #154 describes wanting to be able to set a timeout on Solr requests. This patch allows the user to set a read_timeout and a open_timeout in the configuration. These timeouts are then passed to rsolr as options in the connection and then used when opening up the Net::HTTP connection.

The read_timeout functionality was added to rsolr with [pull request 32](https://github.com/mwmitchell/rsolr/pull/32) on Dec. 1, 2011. This is after the rsolr 1.0.6 release, so it would not have an impact until a new rsolr gem is cut and we update our gemspec to use it.

I have sent a pull request to the rsolr project to [add the open_timeout](https://github.com/mwmitchell/rsolr/pull/37) configuration as well, I hope it will be merged in. Again, this functionality is not in rsolr 1.0.6, but hopefully will be merged in shortly.

If it were helpful, I could break this up into two pull requests, one for the read time out only and one for the open_timeout since the open_timeout pull request has not been merged in yet.

Finally, I tested this on the 1-3-stable as well as the master branch, and all worked perfectly.