Search/SearchProvider.php
public function getSearchResults($pattern, $start = 0, $limit = 50)
    {
        $terms = $this->parse($pattern);
        $results = array();
        
        //sort searchServices by order
        $sortedSearchServices = array();
        foreach($this->searchServices as $service) {
            $sortedSearchServices[$service->getOrder()] = $service;
        }
        
        if ($terms['_domain'] !== NULL) {
            foreach ($sortedSearchServices as $service) {
                if ($service->supports($terms['_domain'])) {
                    $results[] = $service->renderResult($terms, $start, $limit);
                }
            }
            
            if (count($results) === 0) {
                throw new UnknowSearchDomainException($terms['_domain']);
            }
        } else { // no domain provided, we use default search
            foreach($sortedSearchServices as $service) {
                if ($service->isActiveByDefault()) {
                    $results[] = $service->renderResult($terms, $start, $limit);
                }
            }
        }
        
        //sort array
        ksort($results);

        return $results;
    }
public function getSearchResults($pattern, $start = 0, $limit = 50)
    {
        $terms = $this->parse($pattern);
        $results = array();
        
        //sort searchServices by order
        $sortedSearchServices = array();
        foreach($this->searchServices as $service) {
            $sortedSearchServices[$service->getOrder()] = $service;
        }
        
        if ($terms['_domain'] !== NULL) {
            foreach ($sortedSearchServices as $service) {
                if ($service->supports($terms['_domain'])) {
                    $results[] = $service->renderResult($terms, $start, $limit);
                }
            }
            
            if (count($results) === 0) {
                throw new UnknowSearchDomainException($terms['_domain']);
            }
        } else { // no domain provided, we use default search
            foreach($sortedSearchServices as $service) {
                if ($service->isActiveByDefault()) {
                    $results[] = $service->renderResult($terms, $start, $limit);
                }
            }
        }
        
        //sort array
        ksort($results);

        return $results;
    }
public function getSearchResults ( $ pattern , $ start = 0 , $ limit = 50 ) { $ terms = $ this -> parse ( $ pattern ) ; $ results = array ( ) ; //sort searchServices by order $ sortedSearchServices = array ( ) ; foreach ( $ this -> searchServices as $ service ) { $ sortedSearchServices [ $ service -> getOrder ( ) ] = $ service ; } if ( $ terms [ '_domain' ] !== NULL ) { foreach ( $ sortedSearchServices as $ service ) { if ( $ service -> supports ( $ terms [ '_domain' ] ) ) { $ results [ ] = $ service -> renderResult ( $ terms , $ start , $ limit ) ; } } if ( count ( $ results ) === 0 ) { throw new UnknowSearchDomainException ( $ terms [ '_domain' ] ) ; } } else { // no domain provided, we use default search foreach ( $ sortedSearchServices as $ service ) { if ( $ service -> isActiveByDefault ( ) ) { $ results [ ] = $ service -> renderResult ( $ terms , $ start , $ limit ) ; } } } //sort array ksort ( $ results ) ; return $ results ; }
search through services which supports domain and give
results as html string

@param string $pattern
@param number $start
@param number $limit
@return array of html results
@throws UnknowSearchDomainException if the domain is unknow
search through services which supports domain and give results as html string