How to permanently exclude tiddler with a certain field from standard search ?

39 views
Skip to first unread message

Lawine P

unread,
Jan 7, 2023, 10:48:41 AM1/7/23
to TiddlyWiki
Hello everybody,

I'm using the plugin "Streams" for one of my tiddlywiki.
For now, the only but big downside is that the standard search bar is useless as I have a lot of tiddlers with more or less the same name.
I just want to search for the original tiddler who has no field name parent in it.
So I'm currently searching how to add a "!has[parent]" filter on the standard search bar but frankly, I'm stuck on which shadow tiddler I need to modify.

Can you help me ?

Thank you !


Télumire

unread,
Jan 7, 2023, 11:13:19 AM1/7/23
to TiddlyWiki

Lawine P

unread,
Jan 8, 2023, 4:22:05 PM1/8/23
to TiddlyWiki

Sorry I should've have say that I have little to no background in informatic or coding. I already searched on my own on the official tiddlywiki (and saw the link listed here) and searched online if someone has a problem similar to mine.
I kind of understand what is explained in the official wiki but not enough to know where to put the condition.
My actual capabilities are limited to finding a problem similar to mine and just tweak it enough to match what I intend to do right now 

springer

unread,
Jan 10, 2023, 8:03:59 AM1/10/23
to TiddlyWiki
Try this. (It may not be the most elegant, in terms of coding, but it's an easy and safe tweak to do.)

Using Advanced Search, find the system tiddler with this title: $:/core/ui/DefaultSearchResultList

Make a copy (clone) of it, changing the title at the end to something you'll recognize. (That way, you're not directly over-writing the default version.)

In the cloned copy, don't touch the main text body at all. Just change three fields (ignoring back-tick marks, if they show up for you):

`first-search-filter` edit to `[!is[system]!has[parent]search:title<userInput>sort[title]limit[250]]`
`second-search-filter` edit to `[!is[system]!has[parent]search<userInput>sort[title]limit[250]]`
`caption` edit to `top-level` (or whatever you like, to clarify the doesn't-have-parent concept)

What these edits do is just to add the string `!has[parent]` within the search filters, to exclude tiddlers with content in the parent field.

One last step, with that system tiddler in view mode, is to click on the $:/tags/SearchResults tag-pill to get the dropdown of search-result templates, and rearrange the order of the search result types, so that the new custom search you prefer is listed at top.

Come back if any of that does not seem straightforward!

-Springer

Lawine P

unread,
Jan 10, 2023, 5:50:28 PM1/10/23
to TiddlyWiki
Thank you, it's working !
I finally understand that field can be used to define a function too haha. I tried to attribute something to first-search-filter but didn't understand how it's worked.
Thank to your simple and easy explanation, I finally made it.

Have a nice day 
Reply all
Reply to author
Forward
0 new messages