original_string: 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');
          }
      }
code: 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');
          }
      }
code_tokens: 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' ) ; } }
docstring: Checks if the index is ready, triggers an exception otherwise.
  
  @throws \moodle_exception
  @return void
docstring_tokens: Checks if the index is ready triggers an exception otherwise .