Hi cmari
You can exclude fields like this:
\define searchInField(field, for)
<$list filter="[!is[shadow]!is[system]field:$field$/$for$/]">$field$:
<ul><li><$link><$view field="title"/></$link> </li></ul></$list>
\end
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list filter="[!is[shadow]!is[system]fields[]] -title -text -tags" variable
="fieldname">
<$macrocall $name="searchInField" field=<<fieldname>> for={{$:/temp/
advancedsearch}}/>
</$list>
</$reveal>
Best wishes
Jeremy
On Fri, Sep 12, 2014 at 4:28 PM, cmari <[email protected]> wrote:
> Hi Stephan,
> Thanks, that led me down an interesting rabbit-hole. I had to use
> $:/temp/advancedsearch instead of $:/temp/search in order to get any
> results. Then of course, I got results for *all* fields (which of course
> was what I asked for - but quickly realized I didn't actually want!). I
> tweaked things to exclude fields in which the search term wasn't found.
> I'd really like to also exclude the fields "title", "text", and "tags", but
> I couldn't figure out how to do that (and my fumbling efforts produced many
> javascript errors and hung pages). Here's what I came up with, in case it's
> of interest:
>
> \define searchInField(field, for)
> <$list filter="[!is[shadow]!is[system]field:$field$/$for$/]">$field$:
> <ul><li><$link><$view field="title"/></$link> </li></ul></$list>
> \end
> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
> <$list filter="[!is[shadow]!is[system]fields[]]" variable="fieldname">
> <$macrocall $name="searchInField" field=<<fieldname>> for={{$:/temp/
> advancedsearch}}/>
> </$list>
> </$reveal>
>
> cmari
>
>
> On Monday, September 8, 2014 12:05:21 AM UTC-7, Stephan Hradek wrote:
>>
>> Small enhancement:
>>
>> \define searchInField(field, for)
>>
>> <$list filter="[!is[shadow]!is[system]field:$field$/$for$/]">
>>
>> <$link><$view field="title"/></$link>
>>
>> </$list>
>>
>> \end
>>
>> <$reveal state="$:/temp/search" type="nomatch" text="">
>> <$list filter="[!is[shadow]!is[system]fields[]]" variable="fieldname">
>>
>> Searching in field: <<fieldname>>
>>
>> <$macrocall $name="searchInField" field=<<fieldname>>
>> for={{$:/temp/search}}/>
>>
>> </$list>
>> </$reveal>
>>
>>
>> This will hide the results when no search text was entered.
>>
> --
> 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 post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/tiddlywiki.
> For more options, visit https://groups.google.com/d/optout.
>
--
Jeremy Ruston
mailto:[email protected]
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.