diff --git a/src/bundle/Controller/SearchController.php b/src/bundle/Controller/SearchController.php index f0782f4d39..4094ebf1a9 100644 --- a/src/bundle/Controller/SearchController.php +++ b/src/bundle/Controller/SearchController.php @@ -145,7 +145,7 @@ public function searchAction(Request $request): Response $criteria = []; if (null !== $queryString) { - $criteria[] = new Criterion\FullText($queryString); + $query->query = new Criterion\FullText($queryString); } if (null !== $section) { $criteria[] = new Criterion\SectionId($section->id); @@ -181,7 +181,9 @@ public function searchAction(Request $request): Response $query->filter = new Criterion\LogicalAnd($criteria); } - $query->sortClauses[] = new SortClause\DateModified(Query::SORT_ASC); + if (!$this->searchService->supports(SearchService::CAPABILITY_SCORING)) { + $query->sortClauses[] = new SortClause\DateModified(Query::SORT_ASC); + } $pagerfanta = new Pagerfanta( new ContentSearchAdapter($query, $this->searchService)