The vault to search.
query is required. limit defaults to 10. min_score
defaults to 0.05 — anything below is pruned. folder restricts to a
subdirectory.
An envelope with query, total_docs (corpus size), method
(always "tfidf-cosine"), and matches sorted by score desc.
Pure-JS lexical-semantic search via TF-IDF cosine similarity.
Builds (or reuses cached) per-vault TF-IDF index, then ranks notes by cosine similarity of the query vector against each body vector. Catches "related-term" recall that the substring path of searchText misses (e.g. searching
"retrieval"will surface notes about"recall"if the vocabulary co-occurs). Zero native deps — works on every platform with no model download. For full ML retrieval use embeddingsSearch; for graceful-degradation fusion use searchHybrid.