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.

def count(self, index="_all", type='', source='', parameters=None, callback=None):
        """
        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.
        """
        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)