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
| Name | Type | Required | Description |
|---|---|---|---|
aggregations | Aggregation[] | ✓ | The new aggregations to set. |
updateAggregation()
Updates a single aggregation in the store by matching its name.
updateAggregation(aggregation: Aggregation): void
| Name | Type | Required | Description |
|---|---|---|---|
aggregation | Aggregation | ✓ | The 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
| Name | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | The 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');