mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
The doc_modeler gated its query on `FileGroup.indexed == False`, but `indexed` is a full-text-search flag that `apply_indexers` sets on every FileGroup during a refresh. Because the refresh pipeline runs apply_modelers -> apply_indexers, any doc file that reached apply_indexers without first receiving a Doc row (modeler errored, was interrupted, or files imported already-indexed) got `indexed=1` and was then excluded by the `indexed == False` gate forever -- leaving it with model=NULL, no Doc row, and invisible in /api/docs. On one library this stranded 20,795 PDFs/epubs/mobis (only the 10 individually-tagged docs, modeled via the per-file do_model path, showed up). No doc-mimetype files were left with indexed=0, so nothing would ever recover them. Gate the modeler on "no Doc row yet OR explicitly flagged for re-indexing" instead, so already-indexed docs are picked up on the next refresh while preserving re-index behavior and skipping already-modeled docs. Self-healing: a global refresh now models the backlog. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| test | ||
| __init__.py | ||
| api.py | ||
| conftest.py | ||
| extractors.py | ||
| lib.py | ||
| models.py | ||
| schema.py | ||