diff --git a/src/Search/Algolia/Index.php b/src/Search/Algolia/Index.php index 0efa46589d..db8f24b9e2 100644 --- a/src/Search/Algolia/Index.php +++ b/src/Search/Algolia/Index.php @@ -9,6 +9,7 @@ use Statamic\Search\Documents; use Statamic\Search\Index as BaseIndex; use Statamic\Search\IndexNotFoundException; +use Statamic\Search\Result; use Statamic\Support\Str; class Index extends BaseIndex @@ -120,4 +121,12 @@ private function handleAlgoliaException($e) throw $e; } + + public function extraAugmentedResultData(Result $result) + { + return [ + 'search_highlights' => $result->getRawResult()['_highlightResult'] ?? null, + 'search_snippets' => $result->getRawResult()['_snippetResult'] ?? null, + ]; + } }