A false result when you use filter tab in $:/AdvancedSearch

33 views
Skip to first unread message

Mohammad

unread,
Feb 6, 2020, 1:11:41 AM2/6/20
to tiddl...@googlegroups.com
Looking in https://github.com/Jermolene/TiddlyWiki5/issues/4449


- go to tiddlywiki.com
-open the $:/AdvancedSearch
-in the Filter tab enter `[all[tiddlers+shadows]search:text[hirad]]`
-TW shows 1 matches `$:/temp/advancedsearch`

But this is wrong, it searches its temp tiddler and it should be avoided

--Mohammad

A Gloom

unread,
Feb 6, 2020, 5:24:41 AM2/6/20
to TiddlyWiki
Good find Mohammad!  I can see how easy it would be to not foresee that issue.

PMario

unread,
Feb 6, 2020, 8:47:08 AM2/6/20
to tiddl...@googlegroups.com
On Thursday, February 6, 2020 at 7:11:41 AM UTC+1, Mohammad wrote:

If you think it's important, give the issue a +1 "thumbs up" on github.

-m

Eric Shulman

unread,
Feb 6, 2020, 9:00:07 AM2/6/20
to TiddlyWiki
On Wednesday, February 5, 2020 at 10:11:41 PM UTC-8, Mohammad wrote:
- go to tiddlywiki.com
-open the $:/AdvancedSearch
-in the Filter tab enter `[all[tiddlers+shadows]search:text[hirad]]`
-TW shows 1 matches `$:/temp/advancedsearch`

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

Mohammad

unread,
Feb 6, 2020, 9:46:14 AM2/6/20
to TiddlyWiki
Hi Eric,


On Thursday, February 6, 2020 at 5:30:07 PM UTC+3:30, Eric Shulman wrote:
On Wednesday, February 5, 2020 at 10:11:41 PM UTC-8, Mohammad wrote:
Looking in https://github.com/Jermolene/TiddlyWiki5/issues/4449

- go to tiddlywiki.com
-open the $:/AdvancedSearch
-in the Filter tab enter `[all[tiddlers+shadows]search:text[hirad]]`
-TW shows 1 matches `$:/temp/advancedsearch`

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.


True!
 
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.

Is not this an edge use case? 

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)?

Yes, you are right, if one consider the backward compatibility also! I encountered the same problem in Commander and  I just AND !prefix[$:/temp/commander]. Of course in a settings tab, I can see how man temp tiddler I am using and I can delete them.


-e


Best
Mohammad 
Reply all
Reply to author
Forward
0 new messages