In my TiddlyFlex Layout here I’m using a filter expression which you can inspect if you write <<tdff.tiddlyflex-story-river-filter>>
in a Tiddler.
It is called by filter="[subfilter<tdff.tiddlyflex-story-river-filter>]"
It looks like this:
[list<tv-story-list>] :filter[{$:/state/tiddlyflex/story-river/filter}match[yes]then<currentTiddler>search:*:words{$:/temp/search/input}else{$:/state/tiddlyflex/story-river/filter}!match[yes]then<currentTiddler>]
And I thought it would search in all present fields of all tiddlers in the <tv-story-list>
But now I’ve noticed that in one of my wikis it doesn’t show me some tiddlers that are shown if I omit the *
(it’s configurable in the Control Panel under Settings > TiddlyFlex > Story-River Filter Fields-Suffix)
I had a brief look at the search filter operator and the wiki’s search method but don’t yet grasp it
The documentations states that it “causes the search to be performed across all fields available on each tiddler” - but is that so?
Now first of all I’m doubting the correctness of my constructs and then I think about bugs in the core
That’s why I need to dig deeper into my filters…
Writing this I realize that it’s this filter (<<tdff.tiddlyflex-enlist-columns>>
) that is responsible for filtering the columns out of the way (which is the case in my issue):
[list[$:/columns]] :map[{$:/state/tiddlyflex/story-river/filter}match[yes]then<currentTiddler>addprefix[$:/StoryList-]get[list]enlist-input[]search:*:words{$:/temp/search/input}limit[1]then<currentTiddler>else{$:/state/tiddlyflex/story-river/filter}!match[yes]then<currentTiddler>] +[!match[]] ~1
I need to explain it a little bit… It should list all columns (they are numbers in the order 1 2 3 …)
then if the filtering is enabled then map the column as suffix to $:/StoryList-
, get that tiddlers list field and enlist it
then search in the enlisted tiddlers for the search term and if there is one (limit[1]
) then return the column number (which is <currentTiddler>
in this :map[]
filter-run)
The issue in my case is, that it filters out column number 1 of 2 columns, where the search term is in a tiddler title in column 1 and in two tiddler’s text in column 2
I don’t know if anyone here has got the muse to troubleshoot my filters, but if then it’s this second filter I’ve posted that is the culprit (I think)
Then maybe the issue is how I construct the filters which is a bit crazy but always worked:
\function tdff.tiddlyflex-enlist-columns() [[list]addsuffix<tiddlyFlexPrefix>addsuffix[$:/columns]addsuffix<tiddlyFlexSuffix>addsuffix<tiddlyFlexSuffix>addsuffix[ :map]addsuffix<tiddlyFlexPrefix>addsuffix[{$:/state/tiddlyflex/story-river/filter}match]addsuffix<tiddlyFlexPrefix>addsuffix[yes]addsuffix<tiddlyFlexSuffix>addsuffix[then<currentTiddler>addprefix]addsuffix<tiddlyFlexPrefix>addsuffix[$:/StoryList-]addsuffix<tiddlyFlexSuffix>addsuffix[get]addsuffix<tiddlyFlexPrefix>addsuffix[list]addsuffix<tiddlyFlexSuffix>addsuffix[enlist-input]addsuffix<tiddlyFlexPrefix>addsuffix<tiddlyFlexSuffix>addsuffix[search:]addsuffix{$:/config/tiddlyflex/story-river/filter/fields}addsuffix[:]addsuffix{$:/config/tiddlyflex/story-river/filter/flags}addsuffix[{$:/temp/search/input}]addsuffix[limit]addsuffix<tiddlyFlexPrefix>addsuffix[1]addsuffix<tiddlyFlexSuffix>addsuffix[then<currentTiddler>else{$:/state/tiddlyflex/story-river/filter}!match]addsuffix<tiddlyFlexPrefix>addsuffix[yes]addsuffix<tiddlyFlexSuffix>addsuffix[then<currentTiddler>]addsuffix<tiddlyFlexSuffix>addsuffix[ +]addsuffix<tiddlyFlexPrefix>addsuffix[!match]addsuffix<tiddlyFlexPrefix>addsuffix<tiddlyFlexSuffix>addsuffix<tiddlyFlexSuffix>] +[addprefix<tiddlyFlexPrefix>] +[addsuffix[ ~1]]
But I better post the link to the GitHub page with the filters:
I’m constructing the filters like this because it’s difficult to explain but I needed them like that. I’ll try to explain later, maybe somebody has a better idea how to solve the issue I’m trying to workaround using these constructions.
Anyhow, if you want to give it a look, please let me know your findings!
Thank you in advance,
Simon