On Wednesday, February 5, 2020 at 10:11:41 PM UTC-8, Mohammad wrote:
But this wrong, it searches its temp tiddler and it should be avoided
I disagree.
This is the *AdvancedSearch*, intended for use by those who understand and can construct a filter expression by hand while the default sidebar search is intended for everyday TiddlyWiki end-users.
Although it might not be as *expected*, it is arguably *correct* as that tiddler does exist and does contain the indicated text. Keep in mind that, by default, $:/temp tiddlers are retained in the saved document, so it seems to me that always reporting *all* matching tiddlers (even $:/temp tiddlers) is the appropriate action.
Consider some other potentially unexpected use-cases... for example, "[all[tiddlers+shadows]prefix[$:/temp]]" also reports $:/temp/AdvancedSearch, and [all[tiddlers+shadows]prefix[$:/state]] will report $:/state/filterDropdown-* when the downarrow (saved filter) button is pressed, and $:/state/popup/export-* when the export button is pressed.
While the results might not be completely intuitive for the average TiddlyWiki end-user, showing all matching tiddlers without any "magic" exclusions is certainly valid for a TiddlyWiki designer/developer who might be creating and debugging their own custom search interface and needs to verify that *all* tiddlers are being created correctly. I can recall several times where something I wrote wasn't working properly because of an accidental mistake in capitalization of the name of a $:/temp or $:/state tiddler. The only way I found the error was by using $:/AdvancedSearch to confirm which "internal" tiddlers had actually been created by my code.
In any case, how would you propose to exclude this one tiddler from the results? Would it be automatically excluded for all possible AdvancedSearch filters, or somehow only be applied when using "search:text[...]" within a filter? And, for consistency, what should be done for the other use-cases I mentioned above (as well as any other similar use-cases we can think of)?
-e