Constructor
new Aggregation(type, fieldopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string | Aggregation type, ex: "geo_bounds"; |
|
field |
string |
<optional> |
Set the aggregation field. Commonly used in simple aggs such as min or max. |
- Source:
Methods
getName() → {string}
Get the name of the aggregation object. Returns undefined if not set.
- Source:
Returns:
Name of aggregation.
- Type
- string
getName() → {string}
Get the name of the aggregation object. Returns undefined if not set.
- Source:
Returns:
Name of aggregation.
- 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. |
- Source:
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. |
- Source: