]> _ Git - cubist_cms-back.git/commitdiff
done #2976 @0:45
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 26 Aug 2019 13:59:24 +0000 (15:59 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 26 Aug 2019 13:59:24 +0000 (15:59 +0200)
src/app/Magic/Search.php

index 0c298edc7ba484bf1438dc8e31b47616254bf2e3..45ff2985311ebbd26d51a66e3e6adab7f6f7f450 100644 (file)
@@ -78,6 +78,7 @@ class Search
             $short_title = $meta->getAttribute('data-short-title');
             $keywords = $meta->getAttribute('data-keywords');
             $type = $meta->getAttribute('data-type');
+            $breadcrumbs = $meta->getAttribute("data-breadcrumbs");
 
             $body = [
                 'short_title' => $short_title,
@@ -85,6 +86,7 @@ class Search
                 'keywords' => $keywords,
                 'description' => $doc->select('meta[name="description"]')[0]['attributes']['content'],
                 'main' => $doc->getDOM()->saveHTML($doc->select('main', false)->item(0)),
+                'breadcrumbs' => $breadcrumbs,
                 'type' => $type,
             ];
 
@@ -232,7 +234,8 @@ class Search
         $hits = [];
         foreach ($res['hits']['hits'] as $hit) {
             $hits[] = ['url' => $hit['_id'],
-                'title' => $hit['_source']['short_title']
+                'title' => $hit['_source']['short_title'],
+                'breadcrumbs' => json_decode($hit['_source']['breadcrumbs']),
             ];
         }