/** * Deletes a location from the index. * * @param mixed $locationId * @param mixed $contentId */ public function deleteLocation($locationId, $contentId) { $idPrefix = $this->mapper->generateContentDocumentId($contentId); $this->gateway->deleteByQuery("_root_:{$idPrefix}*"); // TODO it seems this part of location deletion (not last location) misses integration tests try { $contentInfo = $this->contentHandler->loadContentInfo($contentId); } catch (NotFoundException $e) { return; } $content = $this->contentHandler->load($contentId, $contentInfo->currentVersionNo); $this->bulkIndexContent(array($content)); }
/** * Generate search document for Content object to be indexed by a search engine. * * @param \eZ\Publish\SPI\Persistence\Content $content * @return \eZ\Publish\SPI\Search\Document */ public function generateDocument(Content $content) { return $this->mapper->mapContentBlock($content); }