]> BookStack Code Mirror - bookstack/blobdiff - app/Search/SearchResultsFormatter.php
Customization: Added parent tag classes
[bookstack] / app / Search / SearchResultsFormatter.php
index 9cbc5ee6862d708457be7ba9b0efe4ef0d0ce335..b06f81e0e0574fa846292bc2cd4a14337f9cb3c8 100644 (file)
@@ -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,