Skip to main content

Aggregations

Overview

Each time a search is performed, the result's aggregations are stored in this store. It is thus easier to access this information directly than from the Result object returned by the backend.

Basic features

update()

Updates the state with the provided aggregations.

update(aggregations: Aggregation[]): void
parametertypedescription
aggregationsAggregation[]The new aggregations to update the state with.

updateAggregation()

Updates an aggregation in the store.

updateAggregation(aggregation: Aggregation): void
parametertypedescription
aggregationAggregationThe aggregation to update the state with.

clear()

Clears the aggregations in the store by setting the aggregations property to an empty array.

clear(): void
info

This method uses the patchState function to update the state of the store.

getAggregation()

Retrieves an aggregation by name or column.

getAggregation(name: string, kind?: 'column' | 'name'): Aggregation
parametertypedescription
namestringThe name or column of the aggregation to retrieve.
kindcolumn | nameThe kind of the name parameter. Default is aggregation's "name".