public function refresh($logFunc = null) {
		$index = $this->getIndex();
        if (!$logFunc) {
            $logFunc = function ($msg) {
                
            };
        }

		foreach ($this->getIndexedClasses() as $class) {
            $logFunc("Indexing items of type $class");
            $this->startBulkIndex();
			foreach ($class::get() as $record) {
                $logFunc("Indexing " . $record->Title);
				$this->index($record);
			}
            
            if (\Object::has_extension($class, 'Versioned')) {
                $live = \Versioned::get_by_stage($class, 'Live');
                foreach ($live as $liveRecord) {
                    $logFunc("Indexing Live record " . $liveRecord->Title);
                    $this->index($liveRecord, 'Live');
                }
            }
            $this->endBulkIndex();
		}
		
	}