TwFusejs Plugin

Fuse.js fuzzy searching for TiddlyWiki

TwFusejs

17th August 2018 at 11:07am

What's This?

The TwFusejs plugin brings fuzzy searching to your TiddlyWikis, powered by Fuse.js. Fuse.js is a lightweight Javascript library without any dependencies on other libraries. It's a simple solution, but not a one-size-fits-it-all one. This plugin is easy to plug into existing TiddlyWikis: just drag it into your wiki. Larger wikis might require a heavier tool. Your mileage may vary.

Demo/Development Wiki Information

This is the TwFusejs plugin version "0.9.3" (release wiki).

Fuzzy Search Showcase

18th July 2020 at 9:13pm

search in tiddlers for:

0 matches for all search terms

Fuzzy Sidebar Searches

18th July 2020 at 1:12pm
This plugin adds fuzzy searches to TiddlyWiki's sidebar search: an additional "Fuzzy" search result tab will automatically appear as you enter search terms into the sidebar search box.

You can make the "Fuzzy" search tab your default result tab. And you can configure whether you want searches to match all terms, or just any of your search terms.

These are the Control Panel settings related to fuzzy searching:

fuse Operator

17th August 2018 at 11:08am
Operator
purposefilter the input by fuzzily searching tiddler content
inputa selection of titles
suffixV = optionally, the name of a variable which either contains Fuse search options in JSON format, or contains the title of a JSON data tiddler with the search options
parameterT = one or more search terms, separated by spaces
outputthose input tiddlers in which all of the search terms can be found
! outputthose input tiddlers in which at least one of the search terms can be found

The output is a list of titles whose contents fuzzily match the T search terms, sorted by relevance (score).

Whether a fuzzy match of at least one or all search terms is required, depends on !:

  • fuse requires all terms to (fuzzily) match,
  • !fuse requires only at least one term to (fuzzily) match.

When the search terms T are empty, they will match no titles and thus the output will be empty, regardless of the input. This avoids unintended matching.

Examples
Fuse Search Options
rendertext Operator
stringlimit Operator