X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/9135a85de4eef32a91c7a3ee0aa405ed454e5a4c..refs/pull/5681/head:/app/Search/SearchResultsFormatter.php diff --git a/app/Search/SearchResultsFormatter.php b/app/Search/SearchResultsFormatter.php index 9cbc5ee68..b06f81e0e 100644 --- a/app/Search/SearchResultsFormatter.php +++ b/app/Search/SearchResultsFormatter.php @@ -2,7 +2,7 @@ namespace BookStack\Search; -use BookStack\Actions\Tag; +use BookStack\Activity\Models\Tag; use BookStack\Entities\Models\Entity; use Illuminate\Support\HtmlString; @@ -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,