diff --git a/eZ/Publish/Core/Search/Common/IncrementalIndexer.php b/eZ/Publish/Core/Search/Common/IncrementalIndexer.php index 24a7e2a76bc..c32966733b9 100644 --- a/eZ/Publish/Core/Search/Common/IncrementalIndexer.php +++ b/eZ/Publish/Core/Search/Common/IncrementalIndexer.php @@ -71,6 +71,8 @@ final public function createSearchIndex(OutputInterface $output, $iterationCount * - not published (draft or trashed) * Then item is removed from index, if not it is added/updated. * + * If generic unhandled exception is thrown, then item indexing is skipped and warning is logged. + * * @param int[] $contentIds * @param bool $commit */ diff --git a/eZ/Publish/Core/Search/Legacy/Content/Indexer.php b/eZ/Publish/Core/Search/Legacy/Content/Indexer.php index 6f5866ad988..d35c22d4c4d 100644 --- a/eZ/Publish/Core/Search/Legacy/Content/Indexer.php +++ b/eZ/Publish/Core/Search/Legacy/Content/Indexer.php @@ -8,6 +8,7 @@ */ namespace eZ\Publish\Core\Search\Legacy\Content; +use Exception; use eZ\Publish\API\Repository\Exceptions\NotFoundException; use eZ\Publish\Core\Persistence\Database\DatabaseHandler; use eZ\Publish\Core\Search\Common\IncrementalIndexer; @@ -46,6 +47,12 @@ public function updateSearchIndex(array $contentIds, $commit) } } catch (NotFoundException $e) { $this->searchHandler->deleteContent($contentId); + } catch (Exception $e) { + $context = [ + 'contentId' => $contentId, + 'error' => $e->getMessage(), + ]; + $this->logger->error('Unable to index the content', $context); } } }