We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7a296dc + 97f769a commit 2bc002aCopy full SHA for 2bc002a
src/Controller/SearchController.php
@@ -6,6 +6,7 @@
6
7
use Bolt\Controller\Frontend\FrontendZoneInterface;
8
use Bolt\Controller\TwigAwareController;
9
+use Bolt\Enum\Statuses;
10
use Bolt\Repository\ContentRepository;
11
use Bolt\TntSearch\TntEngine;
12
use Pagerfanta\Adapter\ArrayAdapter;
@@ -44,7 +45,7 @@ public function search(): Response
44
45
$tnt->selectIndex('records.index');
46
47
$results = $tnt->search($searchTerm, 10000);
- $records = $this->repository->findBy(['id' => $results['ids']]);
48
+ $records = $this->repository->findBy(['id' => $results['ids'], 'status' => Statuses::PUBLISHED]]);
49
$records = new Pagerfanta(new ArrayAdapter($records));
50
$records->setMaxPerPage($amountPerPage);
51
$records->setCurrentPage($page);
0 commit comments