Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-30664: Skipped indexing erroneous Content and logged all exceptions #2666

Merged
merged 2 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eZ/Publish/Core/Search/Common/IncrementalIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
7 changes: 7 additions & 0 deletions eZ/Publish/Core/Search/Legacy/Content/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
}
Expand Down