Embed and update (saved) search results in note

Use case or problem

Brief: Embed search results in a note as a list of links, which will then update in the future, as well as reflect in links on the graph.

Detailed: I’m finding the ability to copy and paste search results a great way to “automatically” populate index notes (or, Maps of Content). Additionally, using the OR function in search is also a great way to capture aliases terms for notes - for example the results of (CDC OR “Centers for Disease Control”) could go into the single CDC MOC.

One shortcoming to this approach, however, is that the MOC will only be current on the day I manually do this process; it will gradually fall out of date as I add more sources, notes, etc until I manually update again.

I’d like if I could define a search term, either in line in the note or by embedding a saved search, which then will update the list of results as I add and update notes elsewhere in my vault.

Proposed solution

Embed a named, saved search; alternatively, define the embedded search within the note, similar to {{date:YY-MM-DD}} function in templates, e.g.:
{{search:(CDC OR “Centers for Disease Control”) (path:“Sources”), sort:created DESC}}
And after this the note would populate a matching list of links.

I guess if I have many of these live/smart indices it could bog down Obsidian with a very large vault, but perhaps this could be resolved by only updating embedded search results with a prompt/command.

Current workaround

I create a saved search, such as (CDC OR “Centers for Disease Control”) (path:“Sources”), sort its results, and then use the “Copy Search Results” function to manually move the list of Wikilinks into the desired note e.g. CDC. Within that note I have a line above the results with the search term and date so I know how to reproduce and when in the future.

I organize my notes into a “Notes” and “Sources” folder; if this were automatic, I imagine including a list of references in most notes via two embedded searches in a ## Related Notes and ## Related Sources section at the end.

Related feature requests (optional)

4 Likes

A post was merged into an existing topic: Transclusion/Embedding for Searches