/** * Search the text and return result collection * * @param string $text * @return \Magento\Catalog\Model\Product[] */ protected function search($text) { $this->resourceFulltext->resetSearchResults(); $query = $this->queryFactory->create(); $query->setQueryText($text)->prepare(); $this->resourceFulltext->prepareResult($this->fulltext, $text, $query); $query->getResultCollection(); $products = []; foreach ($query->getResultCollection() as $product) { $products[] = $product; } return $products; }