nervetattoo/elasticsearch — pull request #45 by jclg (2014-07-24 14:31:25+00:00)
Title: Undefined property when using multiple bulks

When I run the following code, I got a PHP notice :

```php
beginBulk();
$client->index(array('title' => 'My bulked entry 1'));
$client->index(array('title' => 'My bulked entry 2'));
$client->commitBulk();

$client->beginBulk();
$client->index(array('title' => 'My bulked entry 3'));
$client->index(array('title' => 'My bulked entry 4'));
$client->commitBulk();
```

Notice: Undefined property: ElasticSearch\Client::$bulk in /home/jc/github/elasticsearch/src/ElasticSearch/Client.php on line 302

This is because the Client::commitBulk() method unsets $this->bulk.
Then, in the second Client::beginBulk() call, the condition "if (!$this->bulk)" at line 302 fails because $this->bulk is undefined.

To fix this, I replaced the unset $this->bulk by setting $this->bulk to null.
I also add the corresponding test in Client::testBulk()