code: def count(self, index="_all", type='', source='', parameters=None, callback=None):
          
          parameters = parameters or {}
  
          path = self.create_path('count', index=index, type=type, **parameters)
  
          if source:
              source = json_encode(source)
  
          self.post_by_path(path=path, callback=callback, source=source)
docs: The query can either be provided using a simple query string as a parameter 'q',
          or using the Query DSL defined within the request body (source).
          Notice there are additional query string parameters that could be added only with the first option.