Use a Painless script to map values for use in a scripted metric aggregation. A map script is run once per collected document following an optional initialization script and is required as part of a full metric aggregation.
- User-defined parameters passed in as part of the query.
Mapused to add values for processing in a combine script or to be returned from the aggregation.
- Contains the fields of the current document where each field is a
- The similarity score of the current document.
- Use this
Mapto add values for processing in a combine script. Additional values must be of the type
Stringor primitive. The same
Mapis shared between all aggregated documents on a given shard. If an initialization script is provided as part of the aggregation then values added from the initialization script are available. If no combine script is specified, values must be directly stored in
statein a usable form. If no combine script and no reduce script are specified, the
statevalues are used as the result.
- No expected return value.
The standard Painless API is available.