diff --git a/README.md b/README.md index 4c6b0c2..4458e1e 100644 --- a/README.md +++ b/README.md @@ -247,9 +247,9 @@ Its class must implement `FOQ\ElasticaBundle\Provider\ProviderInterface`. { $loggerClosure('Indexing users'); - $this->userType->addDocuments(array( - array('username' => 'Bob') - )); + $document = new \Elastica_Document(); + $document->setData(array('username' => 'Bob')); + $this->userType->addDocuments(array($document)); } }