I am using streams. and I love it , but I ran into a small problem, i cant really search for the streams content of a tiddler, because its all stored in $:/ system /state tiddlers
the advanced search brings up the state tiddler, but i was wondering if there is a better way .
does any one know of a way around this ? perhaps a way to find the actual tiddler that is “hosting” a particular stream i am searching for ?
You’ll need to explain what’s wrong with using the system tab of the advanced search.
I just realized that you can tag the advanced search with $:/tags/SideBar, give it a caption, and have it appear as a tab in the sidebar. Which might be more convenient if you use advanced search a lot.
I believe the problem statement should be , i cannot search for tiddlers using their streams content as search criteria as i would normally search for a tiddler using its text field content as search criteria
so if you would have for example , tiddler A which holds the stream B and undernath it C and D
streams B C D and D despite being displayed as if they are part of the text field , they are not, and are actually separate tiddlers with different names , and so seraching using “B” , “C” or “D” will yield no results
Tidler A
*B
**C
**D
i know this is not inlign with Streams design, and would also yield multiple results as tiddler"B" (in its true name)also holds “C” and “D” ,so searching for D would bring up “A” and “B” but at least that would be better
the streams layout still looks like a standard tiddler with a title and contents ,so it kinda feels like you’d want, as with normal tiddlers ,to find stream tiddlers as well searching by their contents , i dont know is it just me ?
i dont know if i am right, but that’s my use case i guess i store notes in streams , but sometimes cant find the master tiddler holding my notes (streams) because i dont remember exactly the name of the tiddler, and cant really serach on my notes because they are stored in state/system tiddlers
The lazy way would be to just click on the seach result and then use the breadcrumbs shown at the top to navigate to the root tiddler.
The more involved but better way would be to create a custom search view that searches all tiddlers but only shows the root tiddler for each match. There are prior examples/discussion around this in the community, either here on discourse or on https://groups.google.com/g/tiddlywiki/
Depending on the naming standard you use in streams, because its configurable, you may need different strategies to find which tiddler a stream item belongs.
I think the default was tiddlername/serialnumber but since I wanted to keep those out of recent lists I used $:/streams/serial number since the serial numbers are unique.
There are fields in each stream item or the tiddler they belong to you can access to find there source.
As @saqimtiaz suggested there would be value making a custom search. Such a solution would Idealy be independant of the tiddler naming. Hiding the stream item title and showing its content may suggest separating it from the standard search makes sense.
I am looking at adopting streams to help me respond to job applications, so I will keep this in mind. And try and share back.
[Edited]
For example consider this naming standard $:/streams/<<stream-root-title>>/<<now "[UTC]YYYY0MM0DD0hh0mm0ssXXX">> if you allow search of system tiddlers and find a stream item, you can [removeprefix[$:/streams/]split[/]first[]] to get the “stream-root-title”.
I’m not sure whether this is the most efficient approach, but here’s a filter that uses the kin filter operator (unofficial, available as a plugin) to return the “host” tiddler:
Here, I limited the search to system tiddlers since all your streams tiddlers have the system prefix, but you could remove is[system] if you were using a different naming scheme, or further reduce the initial scope of the search by replacing it with the specific streams prefix you’re using.
You could pair this with a custom search box as @saqimtiaz suggested:
Attached is a custom search view for Streams. I personally don’t recommend using system titles (that is starting with $:/) for the nodes, so if that is your naming schema you will need to customize the filters in the fields first-search-filter and second-search-filter to allow system tiddlers.
To make the streams search the default, create a tiddler called $:/config/SearchResults/Default containing the title of the tiddler containing the search view, i.e. $:/plugins/sq/streams-search-results
Here is another variant from a few years ago, that shows the root for each search match, OR the nearest ancestor whose title is not prefixed with its parent’s title.
I believe the usage pattern of the user for whom this was created, was to use automatic titles, and to rename a node if they wanted to make it more visible, which made it show up in search results.
Personally I find logic that relies on tiddler titles to be brittle, for example it all falls apart if you drag and drop a node from one root tiddler to another.
@saqimtiaz the variation you shared is actually what worked best for me ,thank you for your help:) @etardiff thank you for your solution , it works too,i opted for saqim’s as it is integrated in the standard serach as a secondary sub tab which is very convenient (btw i am very familiar with kin filter, you might want to check tagstree filter and ancestors filter,. they do the same thing but for some reason they perfrom way more faster)