def _resolve_nested(self, hit, parent_class=None):
    doc_class = Hit
    nested_path = []
    nesting = hit['_nested']
    while (nesting and ('field' in nesting)):
        nested_path.append(nesting['field'])
        nesting = nesting.get('_nested')
    nested_path = '.'.join(nested_path)
    if hasattr(parent_class, '_index'):
        nested_field = parent_class._index.resolve_field(nested_path)
    else:
        nested_field = self._resolve_field(nested_path)
    if (nested_field is not None):
        return nested_field._doc_class
    return doc_class
def _resolve_nested(self, hit, parent_class=None):
    doc_class = Hit
    nested_path = []
    nesting = hit['_nested']
    while (nesting and ('field' in nesting)):
        nested_path.append(nesting['field'])
        nesting = nesting.get('_nested')
    nested_path = '.'.join(nested_path)
    if hasattr(parent_class, '_index'):
        nested_field = parent_class._index.resolve_field(nested_path)
    else:
        nested_field = self._resolve_field(nested_path)
    if (nested_field is not None):
        return nested_field._doc_class
    return doc_class