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