Apparently clarity is not my strong suit.

Yes. Both your and Eric's solutions work fine when $:/temp/possearch 
contains "Mark" and $:/temp/negsearch contains "Temple." I get a list of 
tiddlers.

Now go to the next step. What happens with your solution when 
$:/temp/possearch contains "Matthew" and $:/temp/negsearch is empty? Using [
search<possearch>] -[search<negsearch>] I get nothing at all. How do I fix 
that?

On Thursday, December 12, 2019 at 9:02:28 PM UTC-6, TonyM wrote:
>
> Stephan
>
> {tiddlername} in filters or {{tiddlername}} in wiki text are not 
> variables, they are transclusions. We use <variablename> in filters and 
> <<variablename>> in wiki text
>
> If you choose to use transclusions the thing you are transcluding needs to 
> contain the value you want used.
>
> Given Erics guidance the simple form is
> [search[Mark]] -[search[Temple]]
>
> Search defaults to tags, text and title if *field list*:  is blank
>
> So If I read your example $:/temp/possearch should contain "Mark" and 
> $:/temp/negsearch 
> should contain "Temple".
>
> Then the filter
> [search{$:/temp/possearch}] -[search{$:/temp/negsearch}]
> should work.,
>
> You could use the edit-text widget to let users enter the value, or even a 
> select widget if you already can search for and identify possible values.
>
> Another way to do this is use variables created from transclusions
> \define posssearch() {{$:/temp/possearch}}
> \define negsearch() {{$:/temp/negsearch}}}
>
> then use the filter
> [search<possearch>] -[search<negsearch>]
>
> Regards
> Tony
>
> On Friday, December 13, 2019 at 6:01:16 AM UTC+11, Stephen Kimmel wrote:
>>
>> I want to combine a pair of search operators within a single filter where 
>> one will be positive and the other negative. For example, I might want a 
>> list of all the tiddlers that contain the word "Mark" but exclude all the 
>> tiddlers that contain the word "temple." The solution I suspect would 
>> involve an expression that looks something like 
>>
>> [search[Mark]!search[Temple]] 
>>
>> but, of course, I want to use variables in the expression. So what I have 
>> at the moment has an expression that looks like this:
>>
>> search{$:/temp/possearch}!search{$:/temp/negsearch}
>>
>> The problem I'm having occurs when $:/temp/negsearch is either empty or 
>> doesn't exist. In that set of circumstances, I get no matches. I would like 
>> the search to act as though it were 
>>
>> search{$:/temp/possearch} 
>>
>> or 
>>
>> search{$:/temp/possearch}!search[xyz123]
>>
>> but I can't figure out how to do that.
>>
>> Any ideas?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e0fbe80e-1a52-496a-9006-24be62edb921%40googlegroups.com.

Reply via email to