public function get_doc_url(\core_search\document $doc) {
        global $DB;
        $section = $DB->get_field('course_sections', 'section', ['id' => $doc->get('itemid')], MUST_EXIST);
        $format = course_get_format($doc->get('courseid'));
        return $format->get_view_url($section);
    }