Once you’ve done the above, delete everything above this line.
Here’s the final report with your debug info:
Steps to reproduce
- Open a vault containing a large number of files (~2,700+)
- Confirm GUI search works: open the search pane (Ctrl+Shift+F) and search for a common word (e.g. “hello”) — results appear as expected
- From a terminal, run:
obsidian search query=hello - Observe: no output is returned, exit code 0
- Open a small vault (e.g. the Sandbox vault or a new vault with 1–2 notes)
- Run:
obsidian search query=hello vault="Obsidian Sandbox" - Observe: results are returned correctly
Did you follow the troubleshooting guide? [Y]
Tested with:
- Restricted mode enabled (all community plugins disabled)
- Default theme, no CSS snippets
- Search index rebuilt
- Full restart of Obsidian
- Sandbox vault as control (CLI search works there)
Expected result
obsidian search query=hello should return a list of matching files, consistent with the GUI search results.
Actual result
The CLI search command returns empty output with exit code 0 on a vault with ~2,740 files. The same command works correctly on small vaults (1–20 files). GUI search works correctly on all vaults.
Additionally, triggering a search via the JavaScript API (eval) confirms the search engine itself is functional:
obsidian eval code="app.workspace.getLeavesOfType('search')[0].view.setQuery('hello')"
obsidian eval code="app.workspace.getLeavesOfType('search')[0].view.dom.resultDomLookup.size"
=> 12
This suggests the CLI search command uses a different code path that does not wait for the search to complete on larger vaults (possible race condition / missing await).
Environment
Obsidian version: 1.12.4
Installer version: 1.12.4
Operating system: Windows 11 Pro 10.0.26200
Login status: logged in
Language: en-GB
Catalyst license: none
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: Vanilla AMOLED 1.0.0
Snippets enabled: 1
Restricted mode: on
Additional information
- Vault contains ~2,740 markdown files across 141 folders
- The
search totalflag also returns empty (not even “0”) - Occasionally the CLI returns “No matches found.” instead of empty output, but still no actual results
- All other CLI commands (
files,tags,tasks,read,vault) work correctly on the same vault - The issue does not appear to be related to
userIgnoreFiltersinapp.json— tested with and without - Tested with community theme disabled as well — no change