ejsPercentilesAggregation

A multi-value metrics aggregation that calculates one or more percentiles over numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script.

Module

 PercentilesAggregation

PercentilesAggregation ( name )

Aggregation that calculates one or more percentiles over 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.
Objectcompression(c)Compression controls memory usage and approximation error. The compression value limits the maximum number of nodes to 100 * compression. By increasing the compression value, you can increase the accuracy of your percentiles at the cost of more memory. Larger compression values also make the algorithm slower since the underlying tree data structure grows in size, resulting in more expensive operations. The default compression value is 100.
Objectfield(field)

Sets the field to operate on.

Objectkeyed(trueFalse)Enable the response to be returned as a keyed object where the key is the bucket interval.
Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites any existing params.
Objectpercent(percentile)Add a single percentile to the current list of percentiles.
Objectpercents(percents)Sets the percentile bucket array. Overwrites all existing values.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
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

 compression

Object compression ( c )
Compression controls memory usage and approximation error. The compression value limits the maximum number of nodes to 100 * compression. By increasing the compression value, you can increase the accuracy of your percentiles at the cost of more memory. Larger compression values also make the algorithm slower since the underlying tree data structure grows in size, resulting in more expensive operations. The default compression value is 100.

Parameters
c <Integer> The compression level.
Returns
returns this so that calls can be chained.

 field

Object field ( field )

Sets the field to operate on.


Parameters
field <String> a valid field name..
Returns
returns this so that calls can be chained.

 keyed

Object keyed ( trueFalse )
Enable the response to be returned as a keyed object where the key is the bucket interval.

Parameters
trueFalse <Boolean> to enable keyed response or not
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.

 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.

 percent

Object percent ( percentile )
Add a single percentile to the current list of percentiles.

Parameters
percentile <Double> A double percentile value to add
Returns
returns this so that calls can be chained.

 percents

Object percents ( percents )
Sets the percentile bucket array. Overwrites all existing values.

Parameters
percents <Double[]> A double array of percentiles
Returns
returns this so that calls can be chained.

 script

Object script ( scriptCode )
Allows you generate or modify the terms/values using a script.

Parameters
scriptCode <String> A valid script string to execute.
Returns
returns this so that calls can be chained.

 scriptFile

Object scriptFile ( scriptFile )
Allows you generate or modify the terms/values using a script.

Parameters
scriptFile <String> A valid script file to execute.
Returns
returns this so that calls can be chained.

 scriptId

Object scriptId ( scriptId )
Allows you generate or modify the terms/values using a script.

Parameters
scriptId <String> A valid script id to execute.
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