Skip to content

Commit cc5b0d1

Browse files
tommyzlisethmlarson
authored andcommitted
[7.x] Update script_fields example to avoid DeprecationWarning
1 parent b162417 commit cc5b0d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

elasticsearch_dsl/search.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,8 @@ def script_fields(self, **kwargs):
480480
s = s.script_fields(
481481
times_three={
482482
'script': {
483-
'inline': "doc['field'].value * params.n",
483+
'lang': 'painless',
484+
'source': "doc['field'].value * params.n",
484485
'params': {'n': 3}
485486
}
486487
}

0 commit comments

Comments
 (0)