@classmethod
def _update_es_facets(cls, search_obj, filterable_attributes=None,
    facet_filter=None):
    """
        This method takes the input `~pyes.query.Search` object, and then
        adds appropriate terms to the `facet` attribute of this object. By
        default, term facets are generated over filterable attributes.
        """
    if not filterable_attributes:
        return
    for attribute in filterable_attributes:
        search_obj.facet.add_term_facet(attribute.name, facet_filter=
            facet_filter, all_terms=attribute.multiselect, size=attribute.
            display_size, order=attribute.display_order)
