Local Search Engine - Passing search parameters from address bar

243 views
Skip to first unread message

Duarte Farrajota Ramos

unread,
Jun 11, 2020, 8:55:28 AM6/11/20
to TiddlyWiki
I'd like to know if it is possible to use a local html wiki as some sort of local search engine?
What I mean is if it is possible to pass search terms using the %s placeholder like a regular search engine and have it passed to the wiki as input on the search field.

Currently one can pass parameters for tiddlers to open directly from the address bar with the hashtag symbol like D:/TiddlyWiki.html#SomeTiddler
It'd be great if one could similarly use something like D:/TiddlyWiki.html%SomeSearchString and have it somehow automatically fill the search filed or get it passed to $:/temp/search.

One could then save a browser bookmark or search engine pointing to D:/TiddlyWiki.html%s and have it behave like a local search engine.
I'm aware there are currently no native features to support this, but is technically feasible or is there a way to do it with through some plugin?

Riz

unread,
Jun 11, 2020, 10:24:45 AM6/11/20
to TiddlyWiki
See https://tiddlywiki.com/#PermaLinks

You can specify a filter in the URL. Since there is a search operator in filters, you can actually pass search variable in URL to Tiddlywiki.

Tiddlywiki has ton of functionality that is kinda hidden in Documentation.

Duarte Farrajota Ramos

unread,
Jun 11, 2020, 10:55:40 AM6/11/20
to TiddlyWiki
Wow indeed! Wasn't aware of these extended permalink features, should have read the documentation more carefully.
This works like a charm, exactly what I wanted.

For the record if anyone else wants to know how, you can simply add to your browser something like
file:///D:/TiddlyWiki.html#:[!is[system]search[%s]]
and it will behave like any search engine. Works both for Chrome-alike as from the search engine list, and for Firefox as a regular bookmark with an alias.

Many thanks for the help, Riz, just what I was looking for.

Rizwan Ishak

unread,
Jun 11, 2020, 11:03:19 AM6/11/20
to TiddlyWiki
Most welcome. May be there is a need to highlight this feature a bit more. 

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/qBZa9XP5c4I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/65698a6d-8f5d-4bb2-9453-a8d5748185bco%40googlegroups.com.

A Gloom

unread,
Jun 14, 2020, 1:36:24 AM6/14/20
to TiddlyWiki

For the record if anyone else wants to know how, you can simply add to your browser something like
file:///D:/TiddlyWiki.html#:[!is[system]search[%s]]
and it will behave like any search engine. Works both for Chrome-alike as from the search engine list, and for Firefox as a regular bookmark with an alias.

:[!is[system]search[%s]] gave mw a Javascript error but useing a normal search term instead of % worked fine.

An note to any one reading-- a lag before anythng displays is normal when using a filter in the permalink.


This trick can also be used with Google docs and sheets (though not tested with a local wiki): https://groups.google.com/d/msg/tiddlywiki/dR8hVQYR2P8/QSLZB-HkDwAJ

Duarte Farrajota Ramos

unread,
Jun 14, 2020, 1:47:28 PM6/14/20
to tiddl...@googlegroups.com
The %s string is a common placeholder for search terms, not something you would enter literally into the address bar.
Say you setup a Firefox bookmark with name
My Wiki, address 
file:///D:/TiddlyWiki.html#:[!is[system]search[%s]] and alias wiki
.
If you then type into the address bar the alias followed by a space then a search term like say  wiki personal notes it would then automatically resolve the address and take you to file:///D:/TiddlyWiki.html#:[!is[system]search[personal notes]] .

If you literally type  file:///D:/TiddlyWiki.html#:[!is[system]search[%s]]  into the address bar it will apparently show a javascript error, if you want to just type directly you would have to actually write  file:///D:/TiddlyWiki.html#:[!is[system]search[my search terms]] manually.

TW Tones

unread,
Jun 14, 2020, 8:22:38 PM6/14/20
to TiddlyWiki
Duarte,

How do you specify the alias in chrome and/or FireFox. IF I understand correctly this can be entered in the address bar and the value following passed into the bookmark(lete) ?

Regards
Tony

Duarte Farrajota Ramos

unread,
Jun 14, 2020, 8:36:33 PM6/14/20
to tiddl...@googlegroups.com
On Chrom* go to Settings > Search > Manage Search Engines. Add a new one and specify the keyword

tiddlywiki_chrome_search.png



On Firefox go to the bookmark manager under the Bookmark Menu > Show All, and specify a keyword. You can also manage them for existing bookmarks from the right-clicking menu on any bookmark and accessing Properties.

tiddlywiki_firefox_search.png

Mohammad Rahmani

unread,
Jun 14, 2020, 11:01:52 PM6/14/20
to tiddl...@googlegroups.com
Wow, this is wonderful! Using Searchwikis plugin and this solution provided by Duarte,
you can have a powerful search engine for local wikis!


Best wishes
Mohammad


On Sun, Jun 14, 2020 at 10:17 PM Duarte Farrajota Ramos <duarte...@gmail.com> wrote:
The %s string is a common placeholder for search terms, not something you would enter literally into the address bar.
Say you setup a firefox bookmark with name My Wiki, address 
file:///D:/TiddlyWiki.html#:[!is[system]search[%s]] and alias wiki
.

--
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 tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5d22186e-821f-4d1e-be1b-8e01b686acc6o%40googlegroups.com.

Duarte Farrajota Ramos

unread,
Jun 15, 2020, 5:54:26 AM6/15/20
to TiddlyWiki
Where can I find this SearchWikis plugin? I searched the forum butt couldn't find anything relevant here or in the plugins library
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

TW Tones

unread,
Jun 15, 2020, 8:43:08 AM6/15/20
to TiddlyWiki
Thank you

I look forward to trying it.

Tony

Mohammad Rahmani

unread,
Jun 15, 2020, 10:09:45 AM6/15/20
to tiddl...@googlegroups.com
Hi Duarte,
 have look at this discussion




Best wishes
Mohammad


To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/894c0836-21ee-435b-a8c9-50f7be80e47fo%40googlegroups.com.

Duarte Farrajota Ramos

unread,
Jun 15, 2020, 10:17:21 AM6/15/20
to TiddlyWiki
Ha there it is. Not sure why it wasn't showing up in previous searches. Thanks, will take a look.

Mohammad

unread,
Jun 15, 2020, 10:22:38 AM6/15/20
to TiddlyWiki
Searchwikis plugin lets to create a central index of all wikis online/offline and then using your method it is possible to search all of them from 
browser!

Duarte Farrajota Ramos

unread,
Jul 4, 2020, 2:00:26 PM7/4/20
to TiddlyWiki
In the meantime I figured TiddlyWiki already filters system tiddlers out by default, so this could be made a little simpler. So for the record here is a canonical post gathering the whole procedure,

Lets say you have a wiki at D:/TiddlyWiki.html and need to search it frequently and conveniently from your browser address bar like you would using any regular web search engine.
As Riz mentioned you can use the Permalinks feature to pass down a Story Filter parameter directly from your address bar, that will determine which tiddlers are open on page load.

Since most browsers interpret %s string in a URL as placeholder that gets replaced by a user search terms, you can setup a search engine or bookmark with a name like My Wiki, address pointing to your wiki like file:///D:/TiddlyWiki.html#:[search[%s]] and keyword wiki.
If you then type into the address bar the keyword followed by a space then a search term like personal notes so that you end up with something like  wiki personal notes it would then automatically resolve the address and take you to file:///D:/TiddlyWiki.html#:[search[personal notes]] .
This will effectively search you wiki for personal notes and open it already displaying a story river of open tiddlers containing your search term personal notes thus behaving similarly to a web search engine.

Don't literally enter  file:///D:/TiddlyWiki.html#:[search[%s]]  into the address bar as it will show a javascript error instead, if you need to just type directly you should replace %s with an actual term like file:///D:/TiddlyWiki.html#:[search[my search terms]].

So all you need to setup either book or a search engine in your browser pointing to your wiki file with a valid %s placeholder and a keyword.
Under Chrome* go to Settings > Search Engines > Manage Search Engines and specify a keyword and a 

For Firefox alike go to the bookmark manager under the Bookmark Menu > Show All, and specify a keyword. You can also manage them for existing bookmarks from the right-clicking menu on any bookmark and accessing Properties.




Replace [search[%s]] with any valid TiddlyWiki Filter you like to present relevant output for your needs.

tony

unread,
Jul 4, 2020, 4:44:58 PM7/4/20
to TiddlyWiki
Thank you so much for this!!

Leveraging the convenience of the browser address bar saves steps of having to go through UI in Advanced Search

Your method works with node.js as you explain so clearly!  Keyword + <search term> expands to 


which opens up mywiki.html with search results in the story river :-) Wow!

Best,
tony 

Joshua Fontany

unread,
Jul 6, 2020, 12:14:30 AM7/6/20
to TiddlyWiki
Great hack/workflow! Impressed. :)

Joshua Fontany

TW Tones

unread,
Jul 6, 2020, 12:50:12 AM7/6/20
to TiddlyWiki
Duarte

I agree with Josua,

Great hack/workflow! Impressed. :)

But I also want to add I have being using Mohammads Search Wikis plugin.
I have a node server on bob which hosts indexes to multiple wikis (lets call this the registry). Using you search method and having it search the registry could be an amazing way to index and search large numbers of disparate wikis.

Wow is all I can say now.

TW Tones

Reply all
Reply to author
Forward
0 new messages