wrolpi/modules/archive/test
Roland 73fafcd645
Search: fast ABC mode by default, opt-in deep search
The file_group.textsearch tsvector indexes all four text columns;
d_text (captions, document text, zip contents) is ~90% of the data,
making ts_rank searches take seconds on large libraries.  Add a
textsearch_abc generated column (title/author/description only, ~8x
smaller) and default all searches to it, with deep=true opting into the
full column.

Database:
- Migration adds the generated column and a GIN index (rewrites the
  table; a few minutes on large libraries).

Backend:
- FilesSearchRequest, VideoSearchRequest, ArchiveSearchRequest, and
  DocSearchRequest accept `deep`; each search function picks the column.
- /api/search_file_estimates returns both counts in one index-bound
  query (COUNT FILTER on the abc subset): `file_groups` (fast) and
  `file_groups_deep`.

UI (one coherent story across the count surfaces):
- The typing dropdown always suggests the deep count (what is findable).
- The tab badge shows the active mode's count so it matches the result
  list.
- The gap is reconciled by a hint offering deep search: count-aware on
  the global search ("No results in fast search. N results available in
  deep search." / "N more results available..."), generic on the module
  pages (no deep estimate there).  The hint resets pagination.
- "Search Depth" toggle in the search filter modals, persisted as
  ?deep=true.

Tests that relied on d_text matches now pass deep=True, with fast-mode
assertions alongside.  Also skip flaky test_download_channel on
CircleCI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:32:16 -06:00
..
__init__.py A new start 2021-11-01 16:43:09 -06:00
test_api.py Search: fast ABC mode by default, opt-in deep search 2026-07-03 10:32:16 -06:00
test_archive_downloader.py Single file deno (#478) 2026-06-12 17:07:28 -06:00
test_archive_modeler_loop.py Fixing bug where not all archives were modeled. 2025-12-18 17:19:57 -07:00
test_collection_id_bug.py Updating archive downloader to use download.destination. 2025-12-17 16:56:58 -07:00
test_compressed_singlefile.py HTML indexer is binary-safe; it indexes the page inside a compressed singlefile. 2026-06-12 17:24:02 -06:00
test_config_import_scenarios.py Detecting collection directories using collection formatting rather than relying on parent directory of file groups, because those are now longer always in the collection directory. 2026-02-07 17:16:08 -07:00
test_domain_tagging.py Fixing bug where configs could be overwritten with empty configs on first refresh. Fixing bug where configs were displayed as JSON in admin settings. 2026-03-22 12:56:37 -06:00
test_domains_config.py Testing that nearly-empty configs are ignored on import. Adding setting to disable automatic upgrade checking. 2025-12-06 15:11:37 -07:00
test_lib.py Search: fast ABC mode by default, opt-in deep search 2026-07-03 10:32:16 -06:00
test_models.py Storing parent_download_url in a file group's json file after download has completed. 2026-03-03 15:54:22 -07:00