code: def add_filter(self, name, filter_values):
          
          # normalize the value into a list
          if not isinstance(filter_values, (tuple, list)):
              if filter_values is None:
                  return
              filter_values = [filter_values, ]
  
          # remember the filter values for use in FacetedResponse
          self.filter_values[name] = filter_values
  
          # get the filter from the facet
          f = self.facets[name].add_filter(filter_values)
          if f is None:
              return
  
          self._filters[name] = f
docs: Add a filter for a facet.