public function get_doc_url(\core_search\document $doc) {
        $users = $this->get_current_other_users($doc);
        $position = 'm'.$doc->get('itemid');
        return new \moodle_url('/message/index.php', array('history' => MESSAGE_HISTORY_ALL,
                'user1' => $users['currentuserid'], 'user2' => $users['otheruserid']), $position);
    }