original_string: public function setup($checkexisting = true) {
          $fields = \search_solr\document::get_default_fields_definition();
  
          // Field id is already there.
          unset($fields['id']);
  
          $this->check_index();
  
          $return = $this->add_fields($fields, $checkexisting);
  
          // Tell the engine we are now using the latest schema version.
          $this->engine->record_applied_schema_version(document::SCHEMA_VERSION);
  
          return $return;
      }
code: public function setup($checkexisting = true) {
          $fields = \search_solr\document::get_default_fields_definition();
  
          // Field id is already there.
          unset($fields['id']);
  
          $this->check_index();
  
          $return = $this->add_fields($fields, $checkexisting);
  
          // Tell the engine we are now using the latest schema version.
          $this->engine->record_applied_schema_version(document::SCHEMA_VERSION);
  
          return $return;
      }
code_tokens: public function setup ( $ checkexisting = true ) { $ fields = \ search_solr \ document :: get_default_fields_definition ( ) ; // Field id is already there. unset ( $ fields [ 'id' ] ) ; $ this -> check_index ( ) ; $ return = $ this -> add_fields ( $ fields , $ checkexisting ) ; // Tell the engine we are now using the latest schema version. $ this -> engine -> record_applied_schema_version ( document :: SCHEMA_VERSION ) ; return $ return ; }
docstring: Setup solr stuff required by moodle.
  
  @param  bool $checkexisting Whether to check if the fields already exist or not
  @return bool
docstring_tokens: Setup solr stuff required by moodle .