def create_document(bookmark):
    """Creates a Document (a dict) for the search engine"""

    return {
        "id": str(bookmark.id),
        "title": bookmark.title or "",
        "notes": bookmark.notes or "",
        "tags": ", ".join([tag.name for tag in bookmark.tags]),
    }