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 asearch(query: string)
method that returns aPromise<TAbstractFile[]>
for the results of the search represented byquery
, which might include Obsidian search operators liketag:
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.