Name search: Type and Last modified filters for tag: searches on the server #1119

Closed
opened 2026-11-04 21:09:40 +00:00 by Cordy · 3 comments
Owner

Since v0.6.399 (#1102) search filters run on the server, but tag: searches use GET /api/v1/tags/find, which takes only tag. So tag: searches show no Type or Last modified pills (before #1102 the page filtered tag rows itself).

Nikola decided 2026-11-04: teach tags/find the same type, from and to parameters as /api/v1/search (same parsing, UTC bounds, type groups from nameindex, the Stat gate for the real type and date), and bring the pills back for tag: searches. Note from the ix1102 final review: a tagged folder whose name ends in a known extension is dropped from a Folders-only tag search today; fix that here too (tags carry no folder flag, so check the type after the Stat).

Since v0.6.399 (#1102) search filters run on the server, but `tag:` searches use `GET /api/v1/tags/find`, which takes only `tag`. So `tag:` searches show no Type or Last modified pills (before #1102 the page filtered tag rows itself). Nikola decided 2026-11-04: teach `tags/find` the same `type`, `from` and `to` parameters as `/api/v1/search` (same parsing, UTC bounds, type groups from `nameindex`, the Stat gate for the real type and date), and bring the pills back for `tag:` searches. Note from the ix1102 final review: a tagged folder whose name ends in a known extension is dropped from a Folders-only tag search today; fix that here too (tags carry no folder flag, so check the type after the Stat).
Author
Owner

Research done (Phase 1, read only, main 666c3d3b): scratch/b7e/backlog/research-1119.md.

Findings:

  • tags/find (tags.go:130-184) reads only tag. It Stats tagged locations in key order and keeps the first 200, with no flag when it stops there. The page hides the pills for tag: (sfBar :19847, sfFilterOn :19541) and treats the answer as complete.
  • Also found: This folder is ignored for tag:. The selector stays visible, but searchURL adds path= only for name searches.
  • The "tagged folder with an extension" drop happens in the name search's tag candidates (searchTagCands pre-filter, searchindex1102.go:264), not in tags/find. Once tags/find checks the type after its Stat, as decided, it is correct by construction.
  • Cross-issue: on S3 a folder Stat has no time, and the gate rejects a zero time whenever from is set (searchindex1102.go:363, inTime). The index itself lets a zero time pass (spec 7.3). So with Last modified (today, 7 or 30 days, this year), no folder matches on S3. That covers the index, tag:, and the spaces from #1132.
  • Market: Dropbox combines tags with Type (including Folders) and Last modified. Drive layers its Type and Modified chips with any term. Nextcloud's files search provider takes since, until, mime and type.

Recommended:

  • One shared filter parser.
  • tags/find reads type, from, to and path. It Stats 8 at a time, examines at most 1,000 and keeps at most 200 that pass the same Types.Has(name, isDir) and inTime checks, and answers capped.
  • In the searchTagCands pre-filter, keep all tag candidates when folders are asked for; the gate judges the real type.
  • Pills back for tag:, with noResultsFiltered when a filter is on.
  • Gate: a folder without a stored time passes date bounds as unknown, the same rule as the index.
  • No new state (#742).

Open questions: Q1 a notice at the cap rather than paging (notice; 2 new strings drafted), Q2 This folder for tag: (yes), Q3 fix the S3 folder-time gate in this batch (yes, as its own task), Q4 pre-filter "folders keep all" rather than asking the index for the folder flag (keep all). No new mockup frame; a caption for the notice is enough.

Research done (Phase 1, read only, main 666c3d3b): `scratch/b7e/backlog/research-1119.md`. Findings: - `tags/find` (`tags.go:130-184`) reads only `tag`. It Stats tagged locations in key order and keeps the first 200, with no flag when it stops there. The page hides the pills for `tag:` (`sfBar` `:19847`, `sfFilterOn` `:19541`) and treats the answer as complete. - Also found: This folder is ignored for `tag:`. The selector stays visible, but `searchURL` adds `path=` only for name searches. - The "tagged folder with an extension" drop happens in the name search's tag candidates (`searchTagCands` pre-filter, `searchindex1102.go:264`), not in `tags/find`. Once `tags/find` checks the type after its Stat, as decided, it is correct by construction. - Cross-issue: on S3 a folder Stat has no time, and the gate rejects a zero time whenever `from` is set (`searchindex1102.go:363`, `inTime`). The index itself lets a zero time pass (spec 7.3). So with Last modified (today, 7 or 30 days, this year), no folder matches on S3. That covers the index, `tag:`, and the spaces from #1132. - Market: Dropbox combines tags with Type (including Folders) and Last modified. Drive layers its Type and Modified chips with any term. Nextcloud's files search provider takes since, until, mime and type. Recommended: - One shared filter parser. - `tags/find` reads `type`, `from`, `to` and `path`. It Stats 8 at a time, examines at most 1,000 and keeps at most 200 that pass the same `Types.Has(name, isDir)` and `inTime` checks, and answers `capped`. - In the `searchTagCands` pre-filter, keep all tag candidates when folders are asked for; the gate judges the real type. - Pills back for `tag:`, with `noResultsFiltered` when a filter is on. - Gate: a folder without a stored time passes date bounds as unknown, the same rule as the index. - No new state (#742). Open questions: Q1 a notice at the cap rather than paging (notice; 2 new strings drafted), Q2 This folder for `tag:` (yes), Q3 fix the S3 folder-time gate in this batch (yes, as its own task), Q4 pre-filter "folders keep all" rather than asking the index for the folder flag (keep all). No new mockup frame; a caption for the notice is enough.
Author
Owner

Decisions (Nikola, 2026-11-05): approved. One filter parser shared by /api/v1/search and tags/find; tags/find takes type, from, to, path, checks the real type and date after the lookup, examines at most 1,000 and keeps 200, answering capped with a notice in the page (2 new strings, shown for approval with the batch 2 mockup); the pills come back for tag: searches; This folder applies to tag: searches; with Folders ticked all tag matches are kept and the access check judges the real type. Built in batch 2.

**Decisions (Nikola, 2026-11-05):** approved. One filter parser shared by `/api/v1/search` and `tags/find`; `tags/find` takes `type`, `from`, `to`, `path`, checks the real type and date after the lookup, examines at most 1,000 and keeps 200, answering `capped` with a notice in the page (2 new strings, shown for approval with the batch 2 mockup); the pills come back for `tag:` searches; This folder applies to `tag:` searches; with Folders ticked all tag matches are kept and the access check judges the real type. Built in batch 2.
Author
Owner

Shipped in v0.6.400 (PR #1136), live on both dogfoods. GET /api/v1/tags/find takes type, from, to and path (same parser and refusals as search); the Type and Last modified pills show for tag: searches; This folder limits to items below the open folder; capped results say so (200 shown, 1,000 checked). A tagged folder named like a file counts as a folder. Live check on the #1005 list.

Shipped in **v0.6.400** (PR #1136), live on both dogfoods. `GET /api/v1/tags/find` takes `type`, `from`, `to` and `path` (same parser and refusals as search); the Type and Last modified pills show for `tag:` searches; This folder limits to items below the open folder; capped results say so (200 shown, 1,000 checked). A tagged folder named like a file counts as a folder. Live check on the #1005 list.
Cordy closed this issue 2026-11-06 12:13:15 +00:00
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#1119
No description provided.