private function getCategoryCollection()
    {
        $categoryCollection = null;

        $suggestedTerms = $this->getSuggestedTerms();
        $terms          = [$this->queryFactory->get()->getQueryText()];

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

        $categoryCollection = $this->categoryCollectionFactory->create();
        $categoryCollection->addAttributeToSelect("is_active");
        $categoryCollection->setSearchQuery($terms);
        $categoryCollection->setPageSize($this->getResultsPageSize());

        return $categoryCollection;
    }
private function getCategoryCollection()
    {
        $categoryCollection = null;

        $suggestedTerms = $this->getSuggestedTerms();
        $terms          = [$this->queryFactory->get()->getQueryText()];

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

        $categoryCollection = $this->categoryCollectionFactory->create();
        $categoryCollection->addAttributeToSelect("is_active");
        $categoryCollection->setSearchQuery($terms);
        $categoryCollection->setPageSize($this->getResultsPageSize());

        return $categoryCollection;
    }
private function getCategoryCollection ( ) { $ categoryCollection = null ; $ suggestedTerms = $ this -> getSuggestedTerms ( ) ; $ terms = [ $ this -> queryFactory -> get ( ) -> getQueryText ( ) ] ; if ( ! empty ( $ suggestedTerms ) ) { $ terms = array_merge ( $ terms , $ suggestedTerms ) ; } $ categoryCollection = $ this -> categoryCollectionFactory -> create ( ) ; $ categoryCollection -> addAttributeToSelect ( "is_active" ) ; $ categoryCollection -> setSearchQuery ( $ terms ) ; $ categoryCollection -> setPageSize ( $ this -> getResultsPageSize ( ) ) ; return $ categoryCollection ; }
Suggested categories collection.
Returns null if no suggested search terms.

@return \Smile\ElasticsuiteCatalog\Model\ResourceModel\Category\Fulltext\Collection|null
Suggested categories collection . Returns null if no suggested search terms .