def get_from_search_doc(cls, doc_id):
        """
        Returns an instance of the model from a search document id.

        :param doc_id: Search document id
        :return: Instance of cls
        """
        # If the document was passed instead of the doc_id, get the document.
        if hasattr(doc_id, 'doc_id'):
            doc_id = doc_id.doc_id
        return cls.from_urlsafe(doc_id)