/** * upates a file in the lucene index * * 1. the file is deleted from the index * 2. the file is readded to the index * 3. the file is marked as index in the status table * * @param Document $doc the document to store for the path * @param int $fileId file id to update * @param bool $commit * * @return void */ public function updateFile(Document $doc, $fileId, $commit = true) { // TODO profile perfomance for searching before adding to index $this->deleteFile($fileId); $this->logger->debug('adding ' . $fileId . ' ' . json_encode($doc)); // Add document to the index $this->index->addDocument($doc); if ($commit) { $this->index->commit(); } }