protected function check_index() {

        // Check that the server is available and the index exists.
        $url = $this->engine->get_connection_url('/select?wt=json');
        $result = $this->curl->get($url);
        if ($this->curl->error) {
            throw new \moodle_exception('connectionerror', 'search_solr');
        }
        if ($this->curl->info['http_code'] === 404) {
            throw new \moodle_exception('connectionerror', 'search_solr');
        }
    }
protected function check_index() {

        // Check that the server is available and the index exists.
        $url = $this->engine->get_connection_url('/select?wt=json');
        $result = $this->curl->get($url);
        if ($this->curl->error) {
            throw new \moodle_exception('connectionerror', 'search_solr');
        }
        if ($this->curl->info['http_code'] === 404) {
            throw new \moodle_exception('connectionerror', 'search_solr');
        }
    }
protected function check_index ( ) { // Check that the server is available and the index exists. $ url = $ this -> engine -> get_connection_url ( '/select?wt=json' ) ; $ result = $ this -> curl -> get ( $ url ) ; if ( $ this -> curl -> error ) { throw new \ moodle_exception ( 'connectionerror' , 'search_solr' ) ; } if ( $ this -> curl -> info [ 'http_code' ] === 404 ) { throw new \ moodle_exception ( 'connectionerror' , 'search_solr' ) ; } }
Checks if the index is ready, triggers an exception otherwise.

@throws \moodle_exception
@return void
Checks if the index is ready triggers an exception otherwise .