Search results sort as the filter dialog says (#959)

* Search results sort as the filter dialog says

Docs sorted ascending orders backwards and fell back to id order for every
descending order (`-size`, `-published_datetime`); it now takes the same `-`
prefixed orders as the other searches and rejects unknown ones with a 400.

Archives and Docs searches without an order now put the most relevant results
first, as Videos does and as the dialog shows.

Rank has no direction in the dialog: choosing it sends `rank` (most relevant
first) instead of inheriting a descending `-rank` (least relevant first).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* An old -rank link becomes rank when the filter dialog closes

The dialog shows Rank without a direction, but it seeded its draft from the URL
unchanged, so Done left a saved `-rank` (least relevant first) in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
lrnselfreliance 2026-11-11 19:42:23 -07:00 • committed by GitHub
parent 2800112f3e
commit f1d344d8a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 170 additions and 33 deletions

View file

@ -12,7 +12,7 @@ class DocSearchRequest:
language: Optional[str] = None
mimetype: Optional[str] = None
tag_names: Optional[list] = dataclasses.field(default_factory=list)
order_by: Optional[str] = 'published_datetime'
order_by: Optional[str] = None # Most relevant first when searching, otherwise newest first.
limit: int = 20
offset: int = 0
deep: bool = False # When True, search all text including document contents (d_text)