search in data tiddler (dictionary and json)

125 views
Skip to first unread message

Mohammad

unread,
Dec 11, 2019, 12:23:42 AM12/11/19
to tiddl...@googlegroups.com
Is there any simple way to search in data tiddler indexes value like what we do for tiddler fields?

Assume you have several data tiddlers with different index names and then you want to search in one or more indexes as we do for fields



--Mohammad

Mark S.

unread,
Dec 11, 2019, 11:21:29 AM12/11/19
to TiddlyWiki
What is it that you want to return? The tiddler that has the value? Or the index?

Mohammad

unread,
Dec 11, 2019, 11:35:05 AM12/11/19
to TiddlyWiki
Hi Mark,
 I need the tiddler name! then I can transclude some indexes.

Normally a list of data tiddler with index/values are displayed on the screen!
I want to search among them and filter the list based on that search result!

For example:

 display all tiddlers have marxsal  in their author index name

and then I have same data tiddlers with
author: marxsal


--Mohammad

Mark S.

unread,
Dec 11, 2019, 12:09:07 PM12/11/19
to TiddlyWiki
You could emulate an index search with regexp:

<$list filter="[type[application/x-tiddler-dictionary]regexp:text[\bauthor: marxsal\b]]">

</$list>

Mohammad

unread,
Dec 11, 2019, 1:23:24 PM12/11/19
to TiddlyWiki
Good idea to start!

of course not all indexes contain exactly what is searched for example 
test: this is a car and it is blue

and then we look for car for example!

but I think your approach should work!

--Mohammad

TiddlyTweeter

unread,
Dec 11, 2019, 2:15:57 PM12/11/19
to TiddlyWiki
That is very useful to know. It would never have occurred to me to use the "type".

Tx, TT

Mohammad

unread,
Dec 11, 2019, 2:57:06 PM12/11/19
to TiddlyWiki
Hi TT,
 Using the Mark approach what do you propose as a  suitable regex pattern to find a word in a index:value pairs?

--Mohammad

TonyM

unread,
Dec 11, 2019, 7:44:46 PM12/11/19
to TiddlyWiki
Mohammad,

Could you not simply have a list widget that extracts each key/value pair then have a listwidget within that that asks if that "contains" the string you are searching for?

Tony

Mohammad

unread,
Dec 11, 2019, 11:33:26 PM12/11/19
to TiddlyWiki
Hi Tony!
 Yes it is possible! I am just curious about performance for a little large list with nested loop!
  Other way is Eric Shulman method to stitch each tiddler to key to value and create a title then search it it and return and extract again tiddler + key

  But as my ultimate application is dynamic tables I am looking for a short and fast method!
  
--Mohammad
Reply all
Reply to author
Forward
0 new messages