/** * Commit all changes * * @param mixed $object * @param bool $refresh * @param bool $forceVersion * * @throws Exception\DoctrineSearchException */ public function flush($object = null, $refresh = false, $forceVersion = false) { if ($forceVersion) { $this->client->setForceVersion(true); } $this->unitOfWork->commit($object, $refresh); if ($forceVersion) { $this->client->setForceVersion(false); } }