Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function getAdditionalSystemFields(Asset $asset): array
return [
DocumentSystemField::IMAGE_THUMBNAIL->value => $this->getImageThumbnail($asset),
DocumentSystemField::PAGE_COUNT->value => $asset->getPageCount(),
DocumentSystemField::TEXT->value => $asset->getText(),
DocumentSystemField::TEXT->value => $this->getAssetText($asset),
];
}

Expand All @@ -64,4 +64,19 @@ private function getImageThumbnail(Document $document): ?string

return null;
}

private function getAssetText(Document $document): ?string
{
try {
return $document->getText();
} catch (Throwable $e) {
$this->logger->error('Text extraction failed for document asset: ' .
$document->getId() .
' error ' .
$e->getMessage()
);
}

return null;
}
}
Loading