Sort Selector
The SortSelectorComponent renders a dropdown for selecting the sort order of search results. It reads available sort options from the application's query configuration and emits the selected choice.
Sort Options Resolution
- Tab search: extracts sorting choices from the specific tab configuration.
- Regular query: uses sorting choices from the query configuration.
- Fallback: returns an empty array if no choices are available.
Flowchart of Sort Options Resolution
Usage
sample.component.ts
import { SortSelectorComponent } from '@sinequa/atomic-angular';
@Component({
selector: 'sample',
imports: [SortSelectorComponent],
template: `<sort-selector [result]="result" (onSort)="onSortChanged($event)" />`,
})
export class SampleComponent {
result = signal<Result | undefined>(undefined);
onSortChanged(sort: SortingChoice) { /* ... */ }
}
API Reference
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
result | Result | ✓ | The search result containing the current query and sort state. |
position | Placement | Dropdown menu position. Default: 'bottom-start'. |
Outputs
| Name | Type | Description |
|---|---|---|
onSort | EventEmitter<SortingChoice> | Emitted when the user selects a new sort option. |