-
-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Background
Currently, species sorting uses label_id which is an auto-increment integer with no correlation to alphabetical species names. This provides stable grouping but not true alphabetical ordering.
Current State
- Location:
internal/datastore/v2/repository/filter_conversion.go:559 species_ascsort useslabel_idordering- True alphabetical sorting requires joining with the labels table
Proposed Solution
- Modify the detection query to JOIN with labels table when species sorting is requested
- Order by
labels.scientific_nameinstead oflabel_id - Consider performance implications (index on scientific_name may be needed)
Example Query Pattern
SELECT d.* FROM detections d
JOIN labels l ON d.label_id = l.id
WHERE ...
ORDER BY l.scientific_name ASCAcceptance Criteria
- Species sorting uses actual species names (scientific_name)
- Performance is acceptable with index support
- Both ascending and descending order work correctly
- Tests for species sorting
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request