ruflin/Elastica — pull request #407 by F21 (2013-06-24 01:20:35+00:00)
Title: Added upsert support when updating with a document. #399

Should close #399.

Usage

```php
$newDocument = new Document(1, array('field1' => 'value1updated', 'field2' => 'value2updated'));
$upsert = new Document('', array('field1' => 'value1', 'field2' => 'value2'));
$type->updateDocument($newDocument, $upsert);

//OR
$newDocument = new Document(1, array('field1' => 'value1updated', 'field2' => 'value2updated'));
$upsert = array(array('field1' => 'value1', 'field2' => 'value2'));
$type->updateDocument($newDocument, $upsert);
```