How to search data tiddler for indexes or values?

147 views
Skip to first unread message

Magnus

unread,
Jan 5, 2019, 6:46:07 PM1/5/19
to TiddlyWiki
I have a custom search that let me search a data tiddler for indexes, but can I also search for the corresponding value? In my abbreviation-x-tiddler-dictionary I would like to be able to search for the name or the abbreviation, I guess I could create one more data tiddler using the same content but revers the indexes for the values but it seems redundant

    <table>
          <$list filter="[[$:/_dictionary/abbreviation]] +[indexes[]search{$:/_state/customSearch}]">
      <tr>
          <td><<currentTiddler>></td>
          <td><$view tiddler="$:/_dictionary/abbreviation" index=<<currentTiddler>>/></td>
          <td><$view tiddler="$:/_dictionary/pronunciation" index=<<currentTiddler>>/></td>
        </tr>
        </$list>
      </table>


Mohammad

unread,
Jan 9, 2019, 4:01:09 AM1/9/19
to TiddlyWiki
The page is in Swedish!
I cannot understand.

I appreciate if you give some example here in English.


--Mohammad

Mark S.

unread,
Jan 9, 2019, 11:14:30 AM1/9/19
to TiddlyWiki
Try:

<table>
          <$list filter="[[:/_dictionary/abbreviation]indexes[]]" >
          <$list filter="[[:/_dictionary/abbreviation]getindex
<currentTiddler>search:title{:/_state/customSearch}]" variable="value">

     
<tr>
         
<td><<currentTiddler>></td>
         
<td><$view tiddler=":/_dictionary/abbreviation" index=<<currentTiddler>>/></td>
         
<td><$view tiddler=":/_dictionary/pronunciation" index=<<currentTiddler>>/></td>
       
</tr>
        </$list>
</$list>
     
</table>

You'll need to put the $ back in (I get frustrated with disappearing tiddlers)

This uses nested lists. The outer one goes through all the terms in the dictionary. The inner one finds the corresponding values and compares them to the search term.

Probably not efficient if you have a huge database. But since there isn't a inverse index search filter, this will have to do ;-)

-- Mark

Magnus

unread,
Mar 12, 2019, 6:26:06 PM3/12/19
to TiddlyWiki
Sorry to resurrect an old tread but I can't get this to work. I can get the results from index OR value in the abbreviation data-tiddler but not from both

barro...@gmail.com

unread,
Apr 5, 2019, 5:17:02 AM4/5/19
to TiddlyWiki


On Tuesday, March 12, 2019 at 6:26:06 PM UTC-4, Magnus wrote:
Sorry to resurrect an old tread but I can't get this to work. I can get the results from index OR value in the abbreviation data-tiddler but not from both


I'm experimenting with it for use in my TW and will let you know what I may figure out but I'm not as knowledgeable as Mark or the others here. 

Reply all
Reply to author
Forward
0 new messages