Skip to content

Commit 0fb0805

Browse files
alexander3771Alexander Myskinsafwanrahman
authored
optimize index nested/object fields (django-es#412)
Co-authored-by: Alexander Myskin <[email protected]> Co-authored-by: Safwan Rahman <[email protected]>
1 parent 28e40ec commit 0fb0805

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django_elasticsearch_dsl/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def _get_inner_field_data(self, obj, field_value_to_ignore=None):
112112
obj, field_value_to_ignore
113113
)
114114
else:
115+
doc_instance = self._doc_class()
115116
for name, field in self._doc_class._doc_type.mapping.properties._params.get(
116117
'properties', {}).items(): # noqa
117118
if not isinstance(field, DEDField):
@@ -121,7 +122,6 @@ def _get_inner_field_data(self, obj, field_value_to_ignore=None):
121122
field._path = [name]
122123

123124
# This allows for retrieving data from an InnerDoc with prepare_field_name functions.
124-
doc_instance = self._doc_class()
125125
prep_func = getattr(doc_instance, 'prepare_%s' % name, None)
126126

127127
if prep_func:

0 commit comments

Comments
 (0)