Movatterモバイル変換


[0]ホーム

URL:


Loading

Metric aggregation map context

Use a Painless script tomap values for use in a scripted metric aggregation. A map script is run once per collected document following an optionalinitialization script and is required as part of a full metric aggregation.

Variables

params (Map, read-only)
User-defined parameters passed in as part of the query.
state (Map)
Map used to add values for processing in acombine script or to be returned from the aggregation.
doc (Map, read-only)
Contains the fields of the current document where each field is aList of values.
_score (double read-only)
The similarity score of the current document.

Side Effects

state (Map)
Use thisMap to add values for processing in a combine script. Additional values must be of the typeMap,List,String or primitive. The samestateMap is 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 instate in a usable form. If no combine script and noreduce script are specified, thestate values are used as the result.

Return

void
No expected return value.

API

The standardPainless API is available.

Welcome to the docs for thelatest Elastic product versions, including Elastic Stack 9.0 and Elastic Cloud Serverless.To view previous versions, go toelastic.co/guide.


[8]ページ先頭

©2009-2025 Movatter.jp