I'm trying to add a scripted field to my query from django-elasticsearch-dsl
I've tried to add a test field like this:
result = ModelDocument.search().script_fields(test="doc['field_name'].value + 10")
for hit in result:
print(hit.to_dict())
but it returns 10 empty dictionary
and if I try it without adding "script_fields":
result = ModelDocument.search()
for hit in result:
print(hit.to_dict())
it returns 10 dictionary filled with my model instance data.
can you please tell me what is the problem and how can i fix it?