/** * Delete index for the current exam entity * * @param \ZendSearch\Lucene\SearchIndexInterface $indexer */ public function deleteIndex($indexer) { $hits = $indexer->find('pk:' . $this->getId()); // there should be only one, but just in case foreach ($hits as $hit) { $indexer->delete($hit); } $indexer->commit(); }
public function commit() { $this->index->commit(); }