/**
  * Adds document to a bulk request for the next commit.
  * Depending on the connection autocommit mode, the update may be committed right away.
  *
  * @param DocumentInterface $document The document entity to index in ES
  */
 public function persist(DocumentInterface $document)
 {
     $documentArray = $this->documentConverter->convertToArray($document);
     $this->persistRaw(get_class($document), $documentArray);
 }