fix: address code review findings (int keys, docstring, empty ordering)

- TantivyRelevanceList.__getitem__ now handles int keys, not just slices
- search_ids() docstring corrected ("no highlights or scores")
- Empty ordering param now correctly becomes None instead of ""

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trenton Holmes
2026-04-05 13:26:10 -07:00
co-authored by Claude Opus 4.6
parent 7649e4a6b1
commit d98dbd50f4
2 changed files with 13 additions and 3 deletions
+1 -1
View File
@@ -2083,7 +2083,7 @@ class UnifiedSearchViewSet(DocumentViewSet):
# Parse ordering param
ordering_param = request.query_params.get("ordering", "")
sort_reverse = ordering_param.startswith("-")
sort_field_name = ordering_param.lstrip("-") if ordering_param else None
sort_field_name = ordering_param.lstrip("-") or None
use_tantivy_sort = (
sort_field_name in TantivyBackend.SORTABLE_FIELDS