Most wikis support this kind of includable search results. So in my point it is not a very special function, but I agree it would be very nice to have in obsidian. To automatically keep MOC’s updated for example …
I am not sure your answer helps exactly, although I understand what you mean - as a space saving device, sure, using a file in the sidebar is a great idea.
I believe this thread is talking about creating a way to embed searches (and all their wonderful combinations of search syntax) as a link. A static page in the sidebar will still not be able to do this unless Obsidian recognises how to interpret those “search links”.
This would be extremely useful to me! I use a lot of ‘fake’ typed links like “- subset [[topic]]” or “- hasTopic [[topic]]”, and I would use this on the topic itself to automatically list eg all papers with that topic
Glad to see more people think this is nice!
+1, but would see it simply as a macro. Something like {{search: … }} using the same functionally as the search box, and yes, using | to then separate display settings for the query. I prefer this approach because it also provides a mechanism for plugins to extend on top of ie. {{plugin-name: …}}. Obsidian then provides the string inside the macro to the plugin, and renders the content it gets back.
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.
When the file templates get inserted into a new markdown file, these aliases are replaced by the output of the script in python. To make things simple for me, I used year and julian date for my indexing scheme and just " OR "d the dates together in the query block that gets generated.
and a weekly assessment report (WAR) template - “war” that looks like this:
in scripts.zip (755 Bytes) you’ll find my python script ‘date_utils.py’. The only Python pip dependency is the fire package. Just pip install fire or do a pip install -r scripts/requirements.txt when you unpack it.
Hope this helps someone! I’m still figuring out how to transclude them. If anyone has pointers I’m all ears!