Index published post/translation bodies in full-text search #66
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: Audit section 1.2 (high impact). Compat contract: "full-text search behaviour MUST stay identical" (
specs/bds.allium).Current behaviour (RuDS): Both FTS index paths pass DB content only:
crates/bds-core/src/engine/post.rsfnfts_index_post(~line 898) passespost.content.as_deref()andt.content.clone().crates/bds-core/src/engine/search.rsfnindex_project(~line 196) does the same during rebuild.Published posts/translations have
content = NULLin the DB (body lives only in the .md file), so their bodies are never indexed — body search over a published blog finds nothing.bDS2 behaviour:
../bDS2/lib/bds/search.ex—post_content/1(~line 657) andtranslation_content/2(~line 670) fall back to reading the markdown body fromfile_pathwhen DB content is nil.Task: Thread
data_dirinto both index paths and read the body from the post/translation file when DB content is NULL (reuseread_post_file/read_translation_file; the editor-body resolver pattern already exists — seespecs/post.alliumeditor_body). Also unify the fallback stemmer language:fts_index_postusesunwrap_or("en")while the rebuild path uses project mainLanguage — bDS2 uses post language, else project main language, in both paths.Acceptance: Red/green TDD — new test: publish a post with a distinctive body word, search finds it; same for a published translation. Rebuild path test likewise.
cargo test --workspacegreen (loopback-server tests need network-bind permission on first run).hopefully fixed with fix on github