library/Controller/Search.php
public function algoliaCustomSearch()
    {
        $this->data['results'] = queryAlgoliaSearch(get_search_query());
        $this->data['keyword'] = get_search_query();

        //Get count per index
        $this->data['resultIndexCount'] = $this->algoliaCustomSearchResultCount($this->data['results']);

        $this->data['resultIndexCountUrl'] = implode("-", $this->data['resultIndexCount']);

        //Total count
        if(isset($_GET['count_data'])) {
            $this->data['resultCount'] = array_sum(explode("-", $_GET['count_data']));
        } else {
            if(is_array($this->data['results'])) {
                $this->data['resultCount'] = count($this->data['results']);
            } else {
                $this->data['resultCount'] = 0;
            }
        }

        //Pagination
        if(is_array($this->data['results'])) {
            $this->data['paginatedResults'] = array_chunk($this->data['results'], 30);
        } else {
            $this->data['paginatedResults'] = array();
        }

        $this->data['pg'] = isset($_GET['pg']) && is_numeric($_GET['pg']) ? $_GET['pg'] : 0;
    }
public function algoliaCustomSearch()
    {
        $this->data['results'] = queryAlgoliaSearch(get_search_query());
        $this->data['keyword'] = get_search_query();

        //Get count per index
        $this->data['resultIndexCount'] = $this->algoliaCustomSearchResultCount($this->data['results']);

        $this->data['resultIndexCountUrl'] = implode("-", $this->data['resultIndexCount']);

        //Total count
        if(isset($_GET['count_data'])) {
            $this->data['resultCount'] = array_sum(explode("-", $_GET['count_data']));
        } else {
            if(is_array($this->data['results'])) {
                $this->data['resultCount'] = count($this->data['results']);
            } else {
                $this->data['resultCount'] = 0;
            }
        }

        //Pagination
        if(is_array($this->data['results'])) {
            $this->data['paginatedResults'] = array_chunk($this->data['results'], 30);
        } else {
            $this->data['paginatedResults'] = array();
        }

        $this->data['pg'] = isset($_GET['pg']) && is_numeric($_GET['pg']) ? $_GET['pg'] : 0;
    }
public function algoliaCustomSearch ( ) { $ this -> data [ 'results' ] = queryAlgoliaSearch ( get_search_query ( ) ) ; $ this -> data [ 'keyword' ] = get_search_query ( ) ; //Get count per index $ this -> data [ 'resultIndexCount' ] = $ this -> algoliaCustomSearchResultCount ( $ this -> data [ 'results' ] ) ; $ this -> data [ 'resultIndexCountUrl' ] = implode ( "-" , $ this -> data [ 'resultIndexCount' ] ) ; //Total count if ( isset ( $ _GET [ 'count_data' ] ) ) { $ this -> data [ 'resultCount' ] = array_sum ( explode ( "-" , $ _GET [ 'count_data' ] ) ) ; } else { if ( is_array ( $ this -> data [ 'results' ] ) ) { $ this -> data [ 'resultCount' ] = count ( $ this -> data [ 'results' ] ) ; } else { $ this -> data [ 'resultCount' ] = 0 ; } } //Pagination if ( is_array ( $ this -> data [ 'results' ] ) ) { $ this -> data [ 'paginatedResults' ] = array_chunk ( $ this -> data [ 'results' ] , 30 ) ; } else { $ this -> data [ 'paginatedResults' ] = array ( ) ; } $ this -> data [ 'pg' ] = isset ( $ _GET [ 'pg' ] ) && is_numeric ( $ _GET [ 'pg' ] ) ? $ _GET [ 'pg' ] : 0 ; }
Algolia custom search
@return void
Algolia custom search