Stage Category: SORT (Reorders documents)Transformation: N documents → N documents (reordered by field value)
When to Use
When NOT to Use
Parameters
Configuration Examples
Field Types
The stage handles various field types:Null Handling
Performance
Common Pipeline Patterns
Search + Filter + Sort
Rerank + Sort (Tie-Breaking)
Dynamic Sort Direction
Comparison: sort_attribute vs rerank
Multiple Sort Criteria
For multi-field sorting, chain multiple sort stages (last sort is primary):featured first, then by created_at for ties.
Error Handling
Call sort_attribute from the API
Add the stage to a retriever’sstages array as {"stage_name": "<your label>", "stage_type": "sort", "config": {"stage_id": "sort_attribute", "parameters": {...}}}. The parameters are the ones on this page.
- Create Retriever (
POST /v1/retrievers) saves a retriever that runs the stage. - Execute Ad-hoc Retriever (
POST /v1/retrievers/execute) runs stages without saving a retriever. - List Available Retriever Stages (
GET /v1/retrievers/stages) returns every stage’s parameter schema.
Related
- Rerank - Neural relevance ranking
- Sample - Reduce result count
- Attribute Filter - Filter before sorting

