This version is out of date, covering development from v9.5.0 to v9.7.3. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

Tinderbox v9 Icon

^similarTo( item, count[, start, list-item-prefix, list-item-suffix, end] )^


Export Code Type: 

Export Code Scope of Action: 

Export Code First Added: 

Export Code Last Altered: 

 Creation of Links   [other codes of this type]

 item   [codes with similar scope]

 Baseline

 As at baseline


^similarTo( "item", count[, "start", "list-item-prefix", "list-item-suffix", "end"] )^

The HTML Export element ^similarTo^ locates notes that appear similar to a given note.

The query will find up to count notes, but may find fewer, and exports a list of notes it finds. The count argument is not evaluated so must be stated as a value and not an expression.

Basic form, returning links to the 10 most similar notes:

^similarTo("this",10)^ 

The longer form is only needed if it is desired to use non-default list HTML mark-up or include extra per-item captioning. If one of the option input is specified, all the others must also be, even if only as the default value(s).

If the optional start, list-item-prefix, list-item-suffix, end arguments are omitted then the default values of <ul>, <li>, </li>, </ul> are used. See more on altering list type or other HTML output.

The code must be used in $Text or directly in a template. If used in a code include to a template, the links generated will have incorrect relative paths.

Similarity is based on several factors, including:

In addition, weighting is applied for:

The results are based on the same logic as the similar tab of the Get Info dialog. The same matching is also available as an action similarTo().

New item objects source and destination may be used with list/item inputs to indicate from where data used within such inputs are drawn.

The export is relative to current rather than this, facilitating work with included files.