Skip to content

Commit

Permalink
Merge branch '1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
kmadejski committed Feb 15, 2019
2 parents 33bc5c4 + 1398555 commit fead905
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bundle/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fead905

Please sign in to comment.