ejsTermsAggregation

A multi-bucket value source based aggregation where buckets are dynamically built - one per unique value.

Module

 TermsAggregation

TermsAggregation ( name )

Defines an aggregation of unique values/terms.


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.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times in order to set multiple nested aggregations what will be executed at the same time as the parent aggregation. Alias for the aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times in order to set multiple nested aggregations what will be executed at the same time as the parent aggregation.
Objectexclude(exclude,flags)

Allows you to filter out unwanted facet entries using a regular expression. You can also optionally pass in a set of flags to apply to the regular expression. Valid flags are: CASE_INSENSITIVE, MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | character.

ObjectexecutionHint(h)Sets the execution hint determines how the aggregation is computed. Supported values are: map and ordinals.
Objectfield(field)

Sets the field to operate on.

Objectformat(f)Sets the format expression for the terms. Use for number or date formatting
Objectinclude(include,flags)

Allows you to allow only specific entries using a regular expression. You can also optionally pass in a set of flags to apply to the regular expression. Valid flags are: CASE_INSENSITIVE, MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | character.

Objectlang(language)The script language being used.
ObjectminDocCount(num)Only return terms that match more than a configured number of hits.
Objectorder(order,direction)Sets order for the aggregated values.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites any existing params.
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.
ObjectshardSize(shardSize)Determines how many terms the coordinating node will request from each shard.
Objectsize(size)Sets the number of aggregation entries that will be returned.
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

 agg

Object agg ( agg )
Add a nesated aggregation. This method can be called multiple times in order to set multiple nested aggregations what will be executed at the same time as the parent aggregation. Alias for the aggregation method.

Parameters
agg <Aggregation> Any valid Aggregation object.
Returns
returns this so that calls can be chained.

 aggregation

Object aggregation ( agg )
Add a nesated aggregation. This method can be called multiple times in order to set multiple nested aggregations what will be executed at the same time as the parent aggregation.

Parameters
agg <Aggregation> Any valid Aggregation object.
Returns
returns this so that calls can be chained.

 exclude

Object exclude ( exclude, flags )

Allows you to filter out unwanted facet entries using a regular expression. You can also optionally pass in a set of flags to apply to the regular expression. Valid flags are: CASE_INSENSITIVE, MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | character.


Parameters
exclude <String> A regular expression exclude string
flags <String> Optional regular expression flags..
Returns
returns this so that calls can be chained.

 executionHint

Object executionHint ( h )
Sets the execution hint determines how the aggregation is computed. Supported values are: map and ordinals.

Parameters
h <String> The hint value as a string.
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.

 format

Object format ( f )
Sets the format expression for the terms. Use for number or date formatting

Parameters
f <String> the format string
Returns
returns this so that calls can be chained.

 include

Object include ( include, flags )

Allows you to allow only specific entries using a regular expression. You can also optionally pass in a set of flags to apply to the regular expression. Valid flags are: CASE_INSENSITIVE, MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ, UNIX_LINES, LITERAL, COMMENTS, and UNICODE_CHAR_CLASS. Separate multiple flags with a | character.


Parameters
include <String> A regular expression include string
flags <String> Optional regular expression flags..
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.

 minDocCount

Object minDocCount ( num )
Only return terms that match more than a configured number of hits.

Parameters
num <Integer> The numer of minimum number of hits.
Returns
returns this so that calls can be chained.

 order

Object order ( order, direction )
Sets order for the aggregated values.

Parameters
order <String> The order string.
direction <String> The sort direction, asc or desc.
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.

 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.

 shardSize

Object shardSize ( shardSize )
Determines how many terms the coordinating node will request from each shard.

Parameters
shardSize <Integer> The numer of terms to fetch from each shard.
Returns
returns this so that calls can be chained.

 size

Object size ( size )
Sets the number of aggregation entries that will be returned.

Parameters
size <Integer> The numer of aggregation entries to be returned.
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