Class: TermsAgg

TermsAgg

Elastic metrics aggregation that calculates an approximate count of distinct values for a field.

link

Constructor

new TermsAgg(field, sizeopt)

Parameters:
Name Type Attributes Description
field string

Name of field to aggregate on.

size int <optional>

Number of buckets to return. Size 0 returns all buckets.

Source:

Extends

Methods

getName() → {string}

Get the name of the aggregation object.

Overrides:
Source:
Returns:

Name of aggregation. Default to '{{field}}Terms'

Type
string

getName() → {string}

Get the name of the aggregation object.

Overrides:
Source:
Returns:

Name of aggregation. Default to '{{field}}Terms'

Type
string

setName(name)

Attach a name to the aggregation object. Can be used when attaching the aggregation to a query. Convenience method to allow responsibility of the name to be given to the creator of the aggregation object. Can be accessed directly but won't show up during serialization.

Parameters:
Name Type Description
name string

Name of aggregation.

Overrides:
Source:

TermsAgg

Elastic metrics aggregation that calculates an approximate count of distinct values for a field.

link

Constructor

new TermsAgg(field, sizeopt)

Parameters:
Name Type Attributes Description
field string

Name of field to aggregate on.

size int <optional>

Number of buckets to return. Size 0 returns all buckets.

Source:

Extends

Methods

getName() → {string}

Get the name of the aggregation object.

Overrides:
Source:
Returns:

Name of aggregation. Default to '{{field}}Terms'

Type
string

getName() → {string}

Get the name of the aggregation object.

Overrides:
Source:
Returns:

Name of aggregation. Default to '{{field}}Terms'

Type
string

setName(name)

Attach a name to the aggregation object. Can be used when attaching the aggregation to a query. Convenience method to allow responsibility of the name to be given to the creator of the aggregation object. Can be accessed directly but won't show up during serialization.

Parameters:
Name Type Description
name string

Name of aggregation.

Overrides:
Source: