src/CwpSearchEngine.php
protected function getSearchQuery($keywords, $classes)
    {
        $query = new SearchQuery();
        $query->classes = $classes;
        $query->addSearchTerm($keywords);
        $query->addExclude(SiteTree::class . '_ShowInSearch', 0);

        // Artificially lower the amount of results to prevent too high resource usage.
        // on subsequent canView check loop.
        $query->setLimit(100);

        // Allow user code to modify the search query before returning it
        $this->extend('updateSearchQuery', $query);

        return $query;
    }
protected function getSearchQuery($keywords, $classes)
    {
        $query = new SearchQuery();
        $query->classes = $classes;
        $query->addSearchTerm($keywords);
        $query->addExclude(SiteTree::class . '_ShowInSearch', 0);

        // Artificially lower the amount of results to prevent too high resource usage.
        // on subsequent canView check loop.
        $query->setLimit(100);

        // Allow user code to modify the search query before returning it
        $this->extend('updateSearchQuery', $query);

        return $query;
    }
protected function getSearchQuery ( $ keywords , $ classes ) { $ query = new SearchQuery ( ) ; $ query -> classes = $ classes ; $ query -> addSearchTerm ( $ keywords ) ; $ query -> addExclude ( SiteTree :: class . '_ShowInSearch' , 0 ) ; // Artificially lower the amount of results to prevent too high resource usage. // on subsequent canView check loop. $ query -> setLimit ( 100 ) ; // Allow user code to modify the search query before returning it $ this -> extend ( 'updateSearchQuery' , $ query ) ; return $ query ; }
Build a SearchQuery for a new search

@param string $keywords
@param array $classes
@return SearchQuery
Build a SearchQuery for a new search