Skip to content

Commit

Permalink
Merge pull request #31 from storefront-bvba/master
Browse files Browse the repository at this point in the history
Made suggestions more in line with search results
  • Loading branch information
Fanny DECLERCK authored Aug 18, 2020
2 parents ce1c3cb + ff67990 commit 2132bbc
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Model/Autocomplete/Page/DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,12 @@ function (\Magento\Search\Model\Autocomplete\Item $termItem) {
*/
private function getCmsPageCollection()
{
$pageCollection = null;
$suggestedTerms = $this->getSuggestedTerms();
$terms = [$this->queryFactory->get()->getQueryText()];

if (!empty($suggestedTerms)) {
$terms = array_merge($terms, $suggestedTerms);
}

$pageCollection = $this->cmsCollectionFactory->create();
$pageCollection->addSearchFilter($terms);

$pageCollection->setPageSize($this->getResultsPageSize());

$queryText = $this->queryFactory->get()->getQueryText();
$pageCollection->addSearchFilter($queryText);

return $pageCollection;
}
Expand Down

0 comments on commit 2132bbc

Please sign in to comment.