The vault to search.
query is required. limit defaults to 10. min_score
defaults to 0.05 — anything below is pruned. folder scopes both corpus
discovery and IDF to a subdirectory.
An envelope with query, total_docs (corpus size), method
(always "tfidf-cosine"), and matches sorted by score desc.
Pure-JS lexical search via TF-IDF cosine similarity.
Builds (or reuses) a bounded, folder-scoped TF-IDF index, then ranks notes by cosine similarity over exact normalized token overlap. TF-IDF weights rare shared words; it does not infer synonyms, paraphrases, or related terms that are absent from the query. Zero native deps — works on every platform with no model download. For conceptual retrieval use embeddingsSearch; for graceful-degradation fusion use searchHybrid.