Search

Start typing to search my site!

Advanced Search Instructions

My search is provided by Lunr: A bit like Solr, but a bit smaller and not as bright. Utilize the search bar provided by my website and search like you would anywhere else! Below are ways to search in a more advanced manner. (From Lunr's documentation on )

Stemming

Stemming is the process of reducing inflected or derived words to their base or stem form. For example, the stem of “searching”, “searched” and “searchable” should be “search”. The stemmer used by Lunr does not guarantee that the stem of a word it finds is an actual word, but all inflections and derivatives of that word should produce the same stem.

Wildcards

Lunr supports wildcards when performing searches. A wildcard is represented as an asterisk (*) and can appear anywhere in a search term. It is worth noting that, when a search term contains a wildcard, no stemming is performed on the search term.

Fields

By default, Lunr will search all fields in a document for the query term, and it is possible to restrict a term to a specific field by prefixing the term with the name of the field (like title:foo). The field must be one of the fields defined when building the index. Unrecognised fields will lead to an error.

Available Fields for My Site

  • title:
  • type:
  • tag:
  • summary:
  • content:

Field-based searches can be combined with all other term modifiers and wildcards, as well as other terms.

Boosts

In multi-term searches, a single term may be important than others. For these cases Lunr supports term level boosts. Any document that matches a boosted term will get a higher relevance score, and appear higher up in the results. A boost is applied by appending a caret (^) and then a positive integer to a term. (i.e foo^10 bar)

Fuzzy Matches

Lunr supports fuzzy matching search terms in documents, which can be helpful if the spelling of a term is unclear, or to increase the number of search results that are returned. The amount of fuzziness to allow when searching can also be controlled. Fuzziness is applied by appending a tilde (~) and then a positive integer to a term. The following search matches all documents that have a word within 1 edit distance of “foo”: foo~1.

An edit distance of 1 allows words to match if either adding, removing, changing or transposing a character in the word would lead to a match. For example “boo” requires a single edit (replacing “f” with “b”) and would match, but “boot” would not as it also requires an additional “t” at the end.

Term Presence

By default, Lunr combines multiple terms together in a search with a logical OR. That is, a search for “foo bar” will match documents that contain “foo” or contain “bar” or contain both. This behaviour is controllable at the term level, i.e. the presence of each term in matching documents can be specified. By default each term is optional in a matching document, though a document must have at least one matching term. It is possible to specify that a term must be present in matching documents, or that it must be absent in matching documents.

To indicate that a term must be present in matching documents the term should be prefixed with a plus (+) and to indicate that a term must be absent the term should be prefixed with a minus (-). Without either prefix the term’s presence in matching documents is optional.