public function getResults()
    {
        // Get request data from request handler
        $request = $this->getRequestHandler()->getRequest();

        $searchTerms = $request->requestVar('Search');
        $query = SearchQuery::create()->addSearchTerm($searchTerms);

        if ($start = $request->requestVar('start')) {
            $query->setStart($start);
        }

        $params = [
            'spellcheck' => 'true',
            'spellcheck.collate' => 'true',
        ];

        // Get the first index
        $indexClasses = FullTextSearch::get_indexes(SolrIndex::class);
        $indexClass = reset($indexClasses);

        /** @var SolrIndex $index */
        $index = $indexClass::singleton();
        $results = $index->search($query, -1, -1, $params);

        // filter by permission
        if ($results) {
            foreach ($results->Matches as $match) {
                /** @var DataObject $match */
                if (!$match->canView()) {
                    $results->Matches->remove($match);
                }
            }
        }
        return $results;
    }
public function getResults()
    {
        // Get request data from request handler
        $request = $this->getRequestHandler()->getRequest();

        $searchTerms = $request->requestVar('Search');
        $query = SearchQuery::create()->addSearchTerm($searchTerms);

        if ($start = $request->requestVar('start')) {
            $query->setStart($start);
        }

        $params = [
            'spellcheck' => 'true',
            'spellcheck.collate' => 'true',
        ];

        // Get the first index
        $indexClasses = FullTextSearch::get_indexes(SolrIndex::class);
        $indexClass = reset($indexClasses);

        /** @var SolrIndex $index */
        $index = $indexClass::singleton();
        $results = $index->search($query, -1, -1, $params);

        // filter by permission
        if ($results) {
            foreach ($results->Matches as $match) {
                /** @var DataObject $match */
                if (!$match->canView()) {
                    $results->Matches->remove($match);
                }
            }
        }
        return $results;
    }
public function getResults ( ) { // Get request data from request handler $ request = $ this -> getRequestHandler ( ) -> getRequest ( ) ; $ searchTerms = $ request -> requestVar ( 'Search' ) ; $ query = SearchQuery :: create ( ) -> addSearchTerm ( $ searchTerms ) ; if ( $ start = $ request -> requestVar ( 'start' ) ) { $ query -> setStart ( $ start ) ; } $ params = [ 'spellcheck' => 'true' , 'spellcheck.collate' => 'true' , ] ; // Get the first index $ indexClasses = FullTextSearch :: get_indexes ( SolrIndex :: class ) ; $ indexClass = reset ( $ indexClasses ) ; /** @var SolrIndex $index */ $ index = $ indexClass :: singleton ( ) ; $ results = $ index -> search ( $ query , - 1 , - 1 , $ params ) ; // filter by permission if ( $ results ) { foreach ( $ results -> Matches as $ match ) { /** @var DataObject $match */ if ( ! $ match -> canView ( ) ) { $ results -> Matches -> remove ( $ match ) ; } } } return $ results ; }
Return dataObjectSet of the results using current request to get info from form.
Simplest implementation loops over all Solr indexes

@return ArrayData
Return dataObjectSet of the results using current request to get info from form . Simplest implementation loops over all Solr indexes