Instead of attempting to modify the existing search, and assuming your have 
master tag for classes, you could make your own search based on the TOC 
macro:

<$macrocall $name="toc" tag="TableOfContents"  
sort="search{$:/temp/search}"/>

You would change TableOfContents to whatever you're root tag is of course. 
This uses the "sort" attribute to sneak in search criteria, using the 
existing search box.


On Sunday, February 16, 2020 at 8:16:47 AM UTC-8, Luca Dorigo wrote:
>
> Hi guys!
>
> I've been using Tiddlywiki extensively for notetaking in university over 
> the last 3 years. 
> As the amount of tiddlers grew, the search results became harder and 
> harder to read - a search with a relatively common word now easily yields 
> 20+ results:
>
> [image: Screenshot 2020-02-16 at 17.04.53.png]
>
>
> All of my tiddlers are organized using tags, in a tree-like structure. 
> Usually there is one "root" tiddler for each course that I am or have been 
> taking, then each chapter/topic in that course is tagged with the course 
> name, subtopics are tagged with their main topic, and so on. For example:
>
> [image: Screenshot 2020-02-16 at 17.07.21.png]
>
>
> I would like to modify the search results so that I can see, next to the 
> title of the result, which course (i.e. "root tag") it belongs to. The 
> problem is that the leaves in my tag tree (so for example, the "Sannon-Fano 
> Algorithm" tiddler in the picture above) have no direct link to the related 
> course, so there's no way to simply express that in wikitext (that I'm 
> aware of). Could you give me some pointer as to what the best way would be 
> to accomplish this?
>
> The only viable option I thought of is to run a bash script to recursively 
> process all tiddlers in my tiddlers folder, to add a field `root_topic: 
> [[Root Topic Title]]` to each and everyone of them. Then, for all future 
> tiddlers, I can manually (or automatically) add this field to point to the 
> relevant root tiddler. I don't particularly like this option though so I 
> was hoping there's some more idiomatic way to do it :-)
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/40cced22-3a70-4b68-be30-e33e6b40d18e%40googlegroups.com.

Reply via email to