@classmethod
def __nested_to_dot(cls, hit, namespace=''):
    """Recursively flattens nested objects to use dot-notation."""
    d = {}
    for k, v in hit.items():
        key = '{}.{}'.format(namespace, k) if namespace else k
        if isinstance(v, dict):
            d.update(cls.__nested_to_dot(v, key))
        else:
            d[key] = v
    return d
