IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Field context
editField context
editUse a Painless script to create a script field to return a customized value for each document in the results of a query.
Variables
-
params
(Map
, read-only) - User-defined parameters passed in as part of the query.
-
doc
(Map
, read-only) -
Contains the fields of the specified document where each field is a
List
of values. -
ctx['_source']
(Map
) -
Contains extracted JSON in a
Map
andList
structure for the fields existing in a stored document. -
_score
(double
read-only) - The original score of the specified document.
Return
-
Object
- The customized value for each document.
API
The standard Painless API is available.