X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/968bc8cdf354d9cbe29b88abdc747a7845031fab..refs/pull/5681/head:/app/Search/SearchResultsFormatter.php diff --git a/app/Search/SearchResultsFormatter.php b/app/Search/SearchResultsFormatter.php index 02a40632e..b06f81e0e 100644 --- a/app/Search/SearchResultsFormatter.php +++ b/app/Search/SearchResultsFormatter.php @@ -25,11 +25,12 @@ class SearchResultsFormatter * Update the given entity model to set attributes used for previews of the item * primarily within search result lists. */ - protected function setSearchPreview(Entity $entity, SearchOptions $options) + protected function setSearchPreview(Entity $entity, SearchOptions $options): void { $textProperty = $entity->textField; $textContent = $entity->$textProperty; - $terms = array_merge($options->exacts, $options->searches); + $relevantSearchOptions = $options->exacts->merge($options->searches); + $terms = $relevantSearchOptions->toValueArray(); $originalContentByNewAttribute = [ 'preview_name' => $entity->name,