search: browse bounded recent items with kind-only queries

This commit is contained in:
2026-10-20 17:54:00 +01:00
parent cce7ea903a
commit 9cdfd9d9ab
12 changed files with 477 additions and 94 deletions
+6 -2
View File
@@ -61,6 +61,8 @@ const (
// SearchRequest is the search request body. Query is the free text, a bare
// status word or a date expression; Kind optionally narrows to one SearchKind;
// Limit caps the returned results (0 = server default).
// Blank Query with a valid nonempty Kind browses recent items of that kind;
// blank Query with empty Kind remains a no-op. Invalid kinds always fail.
type SearchRequest struct {
Query string `json:"query"`
Kind string `json:"kind,omitempty"`
@@ -68,8 +70,10 @@ type SearchRequest struct {
}
// SearchResponse is the ranked, bounded set of matches. Results are ordered by
// score, then recency, then a stable kind/target tie-break. Truncated reports
// that either the result cap or the field-scan budget dropped matches;
// score, then recency, then a stable kind/target tie-break.
// For kind-only browsing, order is recency descending, numeric entity/visit IDs
// descending, then target ascending, without a text-relevance score.
// Truncated reports that either the result cap or the field-scan budget dropped matches;
// ScannedSteps/ScannedBytes and ScanBoundBytes make the body-scan bound
// observable.
type SearchResponse struct {