def render_facet(facet):
    """Renders the facet `facet`.

    `facet` is an elasticsearch-dsl facet, consisting of four items: the string
    display value, the integer count, the string link to apply/unapply
    the facet, and a Boolean indicating whether the facet is selected.

    """
    context = {
        'count': facet[1],
        'label': facet[0],
        'link': facet[2],
        'selected': facet[3],
    }
    return context