code: def get_repository_filter(perceval_backend, perceval_backend_name,
                            term=False):
      
      from .github import GITHUB
  
      filter_ = {}
  
      if not perceval_backend:
          return filter_
  
      field = 'origin'
      value = perceval_backend.origin
  
      if perceval_backend_name in ["meetup", "nntp", "stackexchange", "jira"]:
          # Until tag is supported in all raw and enriched indexes
          # we should use origin. But stackexchange and meetup won't work with origin
          # because the tag must be included in the filter.
          # For nntp we have a common group server as origin, so we need to use also the tag.
          # And in jira we can filter by product, and the origin is the same jira server.
          field = 'tag'
          value = perceval_backend.tag
  
      if perceval_backend:
          if not term:
              filter_ = {"name": field,
                         "value": value}
          else:
              filter_ = '''
                  {"term":
                      { "%s" : "%s"  }
                  }
              ''' % (field, value)
              # Filters are always a dict
              filter_ = json.loads(filter_)
  
      if value in ['', GITHUB + '/', 'https://meetup.com/']:
          # Support for getting all items from a multiorigin index
          # In GitHub we receive GITHUB + '/', the site url without org and repo
          # In Meetup we receive https://meetup.com/ as the tag
          filter_ = {}
  
      return filter_
docs: Get the filter needed for get the items in a repository