rhec/pyelasticsearch — pull request #140 by wk8 (2013-11-09 02:20:25+00:00)
Title: Properly send the timeout value to ElasticSearch

The timeout value isn't currently sent to ElasticSearch, and pyelasticsearch relies solely on the timeout built-in in the `requests` library.

This bypasses the timeout mechanism offered by ElasticSearch (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-body.html), and in particular defeats the purpose of ElasticSearch's really nice feature of being able to provide its 'best-effort' answer when taking too long to compute a query result.

In this pull request:
- I pass the timeout value to ElasticSearch
- trust it (to some extent) to be able to decide it has timed-out by itself

Unit test included.