Create a filter dict with date_field from start to end dates.

        :param date_field: field with the date value
        :param start: date with the from value. Should be a datetime.datetime object
                      of the form: datetime.datetime(2018, 5, 25, 15, 17, 39)
        :param end: date with the to value. Should be a datetime.datetime object
                      of the form: datetime.datetime(2018, 5, 25, 15, 17, 39)
        :return: a dict containing a range filter which can be used later in an
                 es_dsl Search object using the `filter` method.

def __get_query_range(cls, date_field, start=None, end=None):
        """
        Create a filter dict with date_field from start to end dates.

        :param date_field: field with the date value
        :param start: date with the from value. Should be a datetime.datetime object
                      of the form: datetime.datetime(2018, 5, 25, 15, 17, 39)
        :param end: date with the to value. Should be a datetime.datetime object
                      of the form: datetime.datetime(2018, 5, 25, 15, 17, 39)
        :return: a dict containing a range filter which can be used later in an
                 es_dsl Search object using the `filter` method.
        """
        if not start and not end:
            return ''

        start_end = {}
        if start:
            start_end["gte"] = "%s" % start.isoformat()
        if end:
            start_end["lte"] = "%s" % end.isoformat()

        query_range = {date_field: start_end}
        return query_range