Filtering an "or" condition

172 views
Skip to first unread message

Damon Pritchett

unread,
May 25, 2019, 1:05:26 AM5/25/19
to TiddlyWiki
Hello again,

I'm trying to do a filter where I'm doing a search of tiddler titles looking for this word or that word in the title. For example, let's say I have a number of tiddlers with the word vegetarian in it and another group with the word pasta in it. I want to find all tiddlers that have either of those words in the title even if the title contains both. I tried the examples on the Introduction to filter notation page (https://tiddlywiki.com/#Introduction%20to%20filter%20notation), but so far when I do the following:

[search:title[vegetarian]] [search:title[pasta]] 

I get only the titles that have pasta or vegetarian in them. The titles that have both vegetarian and pasta in it do not get listed.

What is the secret sauce for having a true or and not an exclusive or?

Thanks,

Damon

Jed Carty

unread,
May 25, 2019, 5:26:49 AM5/25/19
to TiddlyWiki
That filter isn't an exclusive or. If you go onto tiddlywiki.com and put

{{{[search:title[vegetarian]] [search:title[pasta]] }}}

into a tiddler then make tiddlers called 'Vegetarian Pasta', 'Vegetarian' and 'Pasta' all there appear in the list.

So whatever the problem is, the or part of the filter isn't it.

Is there any more information you can give us?

TonyM

unread,
May 25, 2019, 5:56:43 AM5/25/19
to TiddlyWiki
As Jed says.

Also you may need to recall that the filter reduces the list to have no duplicate title. So a tiddler will not appear twice if it has both tags, only once.

Let us know if you want differently.

tony

Mat

unread,
May 25, 2019, 6:12:35 AM5/25/19
to TiddlyWiki
Contrary to the other guys, I think your question is correct. You want OR not XOR and you're only talking about titles.

I think the regexp operator is the secret sauce; [regexp[vegetarian]] [regexp[pasta]]

<:-)

Jed Carty

unread,
May 25, 2019, 9:34:51 AM5/25/19
to TiddlyWiki
The example I did isn't an exclusive or, check it out on tiddlywiki.com. I don't see how using regexp changes anything here.

Exclusive or is not a simple thing to do directly with filters.

Mat

unread,
May 25, 2019, 10:19:14 AM5/25/19
to TiddlyWiki
Aha, I now understand what the other guys meant. They're right; what you claim is XOR isnt and your examples should actually fulfill what it is you're seeking. As Jed points out, regexp doesn't change anything. (Thanks Jed)

<:-)
Message has been deleted
Message has been deleted

Damon Pritchett

unread,
May 26, 2019, 2:51:56 AM5/26/19
to TiddlyWiki
All, 

I've tried attaching some screen shots of what I'm seeing, but the messages keep getting deleted.

I'll try to explain. My TW has a bunch of companies as individual tiddlers. When I perform the search [search:title[Electric]] in the filter expression tab of advanced search, I get the following:

Atchison Electric Motor & Street Railway
Atchison Electric Street Railway
Atchison Railway & Electric Light Company
Atchison Railway, Electric Light & Power Company

Now when I do this search: [search:title[Electric]] [search:title[Street]], I only get the following:

Atchison Railway & Electric Light Company
Atchison Railway, Electric Light & Power Company

The other two companies disappear which I wouldn't expect. What am I missing? Does do the filter in the advanced search behave differently than within a tiddler (which I haven't tried yet)?

Thanks,

Damon

Mat

unread,
May 26, 2019, 3:34:41 AM5/26/19
to TiddlyWiki
Nope, you're wrong ;-) ;-)

tabort2.PNG



...and in tiddler

tabort.PNG

<:-)

Damon Pritchett

unread,
May 26, 2019, 3:36:57 AM5/26/19
to tiddl...@googlegroups.com
I wish I were but I don’t get the same results. What might be the difference?

Damon

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/n9TynwrsTns/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/7aaff6cc-f113-4ce5-9489-046641c357ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Damon Pritchett

unread,
May 26, 2019, 3:38:00 AM5/26/19
to TiddlyWiki
I wish I were but I don’t get the results you did. What might I be doing wrong?

Damon

Mat

unread,
May 26, 2019, 3:44:15 AM5/26/19
to TiddlyWiki
On Sunday, May 26, 2019 at 9:36:57 AM UTC+2, Damon Pritchett wrote:
I wish I were but I don’t get the same results. What might be the difference?

Did you try it on tiddlywiki.com ?

<:-) 

Mark S.

unread,
May 26, 2019, 9:35:38 AM5/26/19
to TiddlyWiki
Maybe put the screenshots on imgur and provide a link.

Damon Pritchett

unread,
May 26, 2019, 1:45:02 PM5/26/19
to TiddlyWiki
I just tried it on Tiddlywiki by importing the tiddlers in question and then doing the filter search. It all worked as you all described and expected. So there's definitely something in my TW that is the problem. Could there be a shadow tiddler that has been overwritten? Maybe a plugin is doing it? The plugins I have installed are:

* Comments
* Indents
* edit-comptext
* tidgraph
* refnotes

Thanks again,

Damon

Mark S.

unread,
May 26, 2019, 2:33:29 PM5/26/19
to TiddlyWiki
You could disable the plugins, save, reload, and then see if the filter works correctly.

Damon Pritchett

unread,
May 26, 2019, 4:57:10 PM5/26/19
to TiddlyWiki
Disabled all plugins, saved (as new name) and reloaded and the same thing happens so it doesn't appear to be one of the plugins. Is there a way to search for shadow tiddlers that have been modified?

Damon

Mat

unread,
May 26, 2019, 5:00:08 PM5/26/19
to TiddlyWiki
search for shadow tiddlers that have been modified?

Ctrlpanel > first tab > first tab - at very bottom, klick search icon seen there

<:-)

Damon Pritchett

unread,
May 26, 2019, 5:11:09 PM5/26/19
to TiddlyWiki
Thanks, Mat

Did that and reverted a shadow tiddler that $:/config/manager/filter which was the most obvious one to try and that didn't change anything. From the search, there are 54 modified shadow tiddlers, but none of the others are obvious ones to try. Here's the list:


Damon Pritchett

unread,
May 28, 2019, 11:34:57 PM5/28/19
to TiddlyWiki
Hey all,

I've given up trying to figure out what's wrong, so I want to start afresh with a new blank Tiddlywiki file. What is the best way to make sure I get all of my content over to the new file without the plugins & customizations?  Can I just export everything from the old file and import all into the new file? Is bundler better suited for this?

Many thanks,

Damon

PMario

unread,
May 29, 2019, 2:13:25 AM5/29/19
to TiddlyWiki
On Sunday, May 26, 2019 at 8:51:56 AM UTC+2, Damon Pritchett wrote:
 
Atchison Electric Motor & Street Railway
Atchison Electric Street Railway
Atchison Railway & Electric Light Company
Atchison Railway, Electric Light & Power Company

Now when I do this search: [search:title[Electric]] [search:title[Street]], I only get the following:

Atchison Railway & Electric Light Company
Atchison Railway, Electric Light & Power Company


I did test this with tiddlywiki.com and it works as expected. 

So did you include plugins that mess with, or add new filter operators??

-m

Damon Pritchett

unread,
May 30, 2019, 12:00:03 AM5/30/19
to TiddlyWiki
Alright, I've finally figured it out and I feel fairly inept because of it. The filter was working the entire time. I was expecting the combined search to be completely alphabetical when, in fact, they two search results were one right after the other. The results were there, just not sorted the way I expected them to be. Each individual search was alphabetic, but were not combined alphabetically. Is there a way to make the overall results combined alphabetically?

Thanks,

Damon

PMario

unread,
May 30, 2019, 12:15:03 AM5/30/19
to TiddlyWiki
hi,

you ca add a sort operator

-m

Damon Pritchett

unread,
May 30, 2019, 10:44:55 PM5/30/19
to TiddlyWiki
Thanks! I was hoping it was that simple. I am good to go.

Damon
Reply all
Reply to author
Forward
0 new messages