Search by transclusions

Is it possible to filter like this? The search has not given any results. It would be very helpful.simplescreenrecorder-2022-08-11_14.07.54(1)

2 Likes

I’m not really sure what “like this?” means. But I think you want to search for content in field names. So my field-search plugin may be an option. Field Search — lets you search all your fields

1 Like

I would like to have a text version of transclusion so that it can be searched as plain tiddler text with [tag[123]search:text{!!search_table}]. Are there ways to do this?

simplescreenrecorder-2022-08-11_17.52.24(1)

Sorry for my English and inaccurate questions, I am writing to you through google translator.

1 Like

For that you will need to wikify the content of the tiddlers:

<$list filter="[all[tiddlers]!is[system]!is[current]]">


<$wikify name="content" text={{!!text}} >

{{{ [<content>search[desu64]then<currentTiddler>] }}}

</$wikify>

</$list>

The wikify widget will turn the content of each tiddler into its rendered text, that you can then search with a filter. Another way to do that would be to first search for your content, find the title of the tiddler transcluded then search for that tiddler, that way you wont need to use wikify (which is slow).


<$edit-text field="search"/>

{{{ [search:text{!!search}]:map[all[tiddlers]!is[system]search:text:literal<currentTiddler>] }}}

demo : How to search by transclusions

6 Likes

Thanks for the detailed answer! Exactly what is needed.

I created two tiddlers like below

title: Tid01
text: This is a cat.

title: Tid02
text: This is a dog and {{Tid01}}

Then I search for cat!
It returns only Tid02. Is this correct?

The fast method, return some other tiddlers!
Then I search for cat

@Mohammad This should do a bit better :

<$let search={{!!search}}>
{{{ [!is[system]search:text:literal<search>addprefix[{]]:map:flat[all[tiddlers]!is[system]search:text:literal<currentTiddler>] }}}
</$let>
2 Likes

Yes, this works better!

Side note:
I love your simple search (in demo wiki)! Your implementation is really simple, minimal and elegant! :wink:

1 Like

That’s a very clever code. Kudos!

1 Like

Very clever!

I assume you could do the same using Regexp Operations?

Probably but I’m not a regex expert :sweat_smile:
If you want to try, here are several helpful websites :

EDIT: Giving credit where credit is due :wink:

I helped him write it :slight_smile:

3 Likes