Skip to main content
Version: 11.14.0

Aggregations

Each time a search is performed, the result's aggregations are stored in this store. This makes it easier to access aggregation data directly rather than from the Result object.

Methods

update()

Replaces the current aggregations state with the provided array.

update(aggregations: Aggregation[]): void
NameTypeRequiredDescription
aggregationsAggregation[]The new aggregations to set.

updateAggregation()

Updates a single aggregation in the store by matching its name.

updateAggregation(aggregation: Aggregation): void
NameTypeRequiredDescription
aggregationAggregationThe aggregation to update.

clear()

Resets the aggregations to an empty array.

clear(): void

getAggregation()

Retrieves an aggregation by name or column.

getAggregation(name: string, kind?: 'column' | 'name'): Aggregation
NameTypeRequiredDescription
namestringThe name or column of the aggregation to retrieve.
kind'column' | 'name'Whether name refers to the aggregation name or column. Default: 'name'.

Returns Aggregation — the matching aggregation.

Example

example.component.ts
import { inject } from '@angular/core';
import { AggregationsStore } from '@sinequa/atomic-angular';

const agg = inject(AggregationsStore).getAggregation('geo', 'column');