/** * @param BaseElasticsearchEntity $entity * @param bool $refresh * * @throws \Exception */ public function save($entity, $refresh = false) { $this->_sm->persist($entity); $this->_sm->flush($entity); if ($refresh) { $this->_sm->getClient()->refreshIndex($this->getClassMetadata()->getIndexForWrite($entity->toESDocument())); } }
protected function doPersistEntities($entities) { $this->searchManager->persist($entities); }