ejsScriptedMetricAggregation

A metric aggregation that executes using scripts to provide a metric output.

Module

 ScriptedMetricAggregation

ScriptedMetricAggregation ( name )

Aggregation that keeps track and returns the minimum value among numeric values extracted from the aggregated documents.


Parameters
name <String> The name which be used to refer to this aggregation.

Method Summary

Returns Name Description
String_type()The type of ejs object. For internal use only.
ObjectcombineScript(combineScript)

Sets the combine phase script.

ObjectcombineScriptFile(combine_script_file)

Sets the combine_script_file.

ObjectcombineScriptId(combine_script_id)

Sets the combine_script_id.

ObjectinitScript(initScript)

Sets the initialization script.

ObjectinitScriptFile(init_script_file)

Sets the init_script_file.

ObjectinitScriptId(init_script_id)

Sets the init_script_id.

Objectlang(language)The script language being used.
Objectlang(lang)

Set the scripting language used for this aggregation.

ObjectmapScript(mapScript)

Sets the map script. This is the only required script.

ObjectmapScriptFile(map_script_file)

Sets the map_script_file.

ObjectmapScriptId(map_script_id)

Sets the map_script_id.

Objectparams(p)Sets parameters that will be applied to the script. Overwrites any existing params.
Objectparams(params)

Set parameters which will be passed to the init, map and combine scripts.

ObjectreduceParams(reduceParams)

Set parameters which will be passed to the reduce script.

ObjectreduceScript(reduceScript)

Sets the combine phase script.

ObjectreduceScriptFile(reduce_script_file)

Sets the reduce_script_file.

ObjectreduceScriptId(reduce_script_id)

Sets the reduce_script_id.

StringtoJSON()

Retrieves the internal agg object. This is typically used by internal API functions so use with caution.


Method Detail

 _type

String _type ( )
The type of ejs object. For internal use only.

Returns
the type of object

 combineScript

Object combineScript ( combineScript )

Sets the combine phase script.


Parameters
combineScript <String> The combine script.
Returns
returns this so that calls can be chained.

 combineScriptFile

Object combineScriptFile ( combine_script_file )

Sets the combine_script_file.


Parameters
combine_script_file <String> A valid script file name.
Returns
returns this so that calls can be chained.

 combineScriptId

Object combineScriptId ( combine_script_id )

Sets the combine_script_id.


Parameters
combine_script_id <String> A valid id from indexed script.
Returns
returns this so that calls can be chained.

 initScript

Object initScript ( initScript )

Sets the initialization script.


Parameters
initScript <String> The initialization script
Returns
returns this so that calls can be chained.

 initScriptFile

Object initScriptFile ( init_script_file )

Sets the init_script_file.


Parameters
init_script_file <String> A valid script file name.
Returns
returns this so that calls can be chained.

 initScriptId

Object initScriptId ( init_script_id )

Sets the init_script_id.


Parameters
init_script_id <String> A valid id from indexed script.
Returns
returns this so that calls can be chained.

 lang

Object lang ( language )
The script language being used.

Parameters
language <String> The language of the script.
Returns
returns this so that calls can be chained.

 lang

Object lang ( lang )

Set the scripting language used for this aggregation.


Parameters
lang <String> The script langauge.
Returns
returns this so that calls can be chained.

 mapScript

Object mapScript ( mapScript )

Sets the map script. This is the only required script.


Parameters
mapScript <String> The map script.
Returns
returns this so that calls can be chained.

 mapScriptFile

Object mapScriptFile ( map_script_file )

Sets the map_script_file.


Parameters
map_script_file <String> A valid script file name.
Returns
returns this so that calls can be chained.

 mapScriptId

Object mapScriptId ( map_script_id )

Sets the map_script_id.


Parameters
map_script_id <String> A valid id from indexed script.
Returns
returns this so that calls can be chained.

 params

Object params ( p )
Sets parameters that will be applied to the script. Overwrites any existing params.

Parameters
p <Object> An object where the keys are the parameter name and values are the parameter value.
Returns
returns this so that calls can be chained.

 params

Object params ( params )

Set parameters which will be passed to the init, map and combine scripts.


Parameters
params <String> Parameters passed to the init, map and combine scripts.
Returns
returns this so that calls can be chained.

 reduceParams

Object reduceParams ( reduceParams )

Set parameters which will be passed to the reduce script.


Parameters
reduceParams <String> Paramters to pass to the recude script.
Returns
returns this so that calls can be chained.

 reduceScript

Object reduceScript ( reduceScript )

Sets the combine phase script.


Parameters
reduceScript <String> The reduce script.
Returns
returns this so that calls can be chained.

 reduceScriptFile

Object reduceScriptFile ( reduce_script_file )

Sets the reduce_script_file.


Parameters
reduce_script_file <String> A valid script file name.
Returns
returns this so that calls can be chained.

 reduceScriptId

Object reduceScriptId ( reduce_script_id )

Sets the reduce_script_id.


Parameters
reduce_script_id <String> A valid id from indexed script.
Returns
returns this so that calls can be chained.

 toJSON

String toJSON ( )

Retrieves the internal agg object. This is typically used by internal API functions so use with caution.


Returns
returns this object's internal object.

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo