FR: Expose the Obsidian search parser or functionality

This post has been migrated from the obsidian-api repo:

It can be very valuable if the API would allow plugins to use the Obsidian note search syntax.
For example, Vault could have a search(query: string) method that returns a Promise<TAbstractFile[]> for the results of the search represented by query, which might include Obsidian search operators like tag: and others.
As of today, plugins wishing to implement a file search box currently need to duplicate this functionality, which is unfortunate because the query options that Obsidian supports make a powerful tool, and we rather use the same syntax in plugins.

As a nice bonus, it would be great to have a FileSearchQuery text box component that would show the user tips as in Obsidian’s Find in Files pane and Graph View.

1 Like