How search matches your text

The single most common source of confusion is that the = sign means two different things depending on where it appears. Read this section once and the rest of search becomes predictable.

There are three matching modes:

ModeHow you trigger itWhat it matchesSubstring?Fuzzy (typos)?
Defaulttype words with no prefixwhole words and substrings, anywhere in title, content or attributes, relevance-rankedYesYes
Exact full-texta leading = (e.g. =sync)the exact whole word or phrase, ignoring surrounding punctuationNoNo
Attribute / property equality= inside a #label=value or note.property=value clausethe entire attribute or property value, exactlyNoNo

Default matching (no prefix)#

Rule: typing words with no prefix finds notes that contain those words anywhere in the title, content or attributes, as whole words or as substrings. The closest matches are ranked first.

QueryExample note contentMatches?Why
syncplease sync the foldersYes (ranked higher)contains the exact word sync
syncsynchronize the database nowYes (ranked lower)sync is a substring of synchronize

Exact match with the = prefix#

Rule: a leading = switches the full-text search to exact matching. It finds the whole word or phrase only, ignoring surrounding punctuation, with no substring and no fuzzy matching. Use it when a normal search returns too many near-matches.

QueryExample note contentMatches?Why
=syncsee (sync) modeYes(sync) is the whole word sync; punctuation is ignored
=syncin sync, then continueYessync, is the whole word sync
=synche said "sync" out loudYes"sync" is the whole word sync
=syncsynchronize the database nowNo= never matches substrings
=syncplease send the fileNo= never matches typos / fuzzy

To match an exact phrase, quote it after the = (single, double or backtick quotes all work). The phrase must appear as consecutive words, but punctuation between or around them is ignored:

QueryExample note (title or content)Matches?Why
="project plan"title Project PlanYesthe title is exactly the phrase
="project plan"the (project plan) is ready to shareYesthe consecutive phrase appears; punctuation is ignored
="project plan"the plan for this project is lateNothe words are present but not consecutive

Attribute and property equality (=, !=)#

Rule: when = compares an attribute or property, as in #label=value or note.title=value, it is strict full-value equality: the whole value must equal what you typed, ignoring case and diacritics. This is not word matching. != inverts it.

The examples below assume four notes: Austria (#capital=Vienna), Somewhere (#capital=Vienna Austria), Czech Republic (#capital=Prague) and Switzerland (#capital=Zürich).

QueryExample label valueMatches?Why
#capital=ViennaViennaYesthe whole value equals Vienna
#capital=ViennaVienna AustriaNothe whole value is Vienna Austria, not Vienna
#capital="Vienna Austria"Vienna AustriaYesquote a multi-word value to match it in full
#capital=ZurichZürichYesequality ignores diacritics
#capital!=ViennaPragueYes!= matches every value that is not Vienna
#capital!=ViennaViennaNo!= excludes the exact value

Quick search relaxes this. The Quick search bar and autocomplete treat an attribute = as "contains", so #capital=Vienna typed there also matches Vienna Austria. The strict full-value equality described here applies only in the full Search.

Fuzzy operators (~= and ~*)#

Rule: the fuzzy operators tolerate typos. ~= (fuzzy-equals) matches a value that is a close whole-word variant of your term. ~* (fuzzy-contains) matches when your term appears anywhere inside the value, either as a fragment or as a near-miss. Both work on note properties such as note.title and note.content, and on labels (#label). Fuzzy operators accept terms of at least 3 characters, though how many typos each term tolerates depends on its length — see Fuzzy tolerance below.

The examples assume a note titled Books carrying the label #author=Tolkien, and a note whose content is learn programming today.

QueryExample valueMatches?Why
note.title ~= bokstitle BooksYesone edit away from books
#author ~= tolkeinauthor TolkienYestolkein is a typo of tolkien
note.content ~* progrlearn programming todayYesprogr is a fragment of programming
note.content ~* programinglearn programming todayYesprograming is one edit from programming

Fuzzy tolerance#

Rule: how many typos are tolerated depends on the length of your search term. Short terms must match exactly, because a single edit is enough to turn one short word into an unrelated one; longer terms have greater tolerance.

Term lengthEdits allowed
1–3 characters0 (exact only)
4–6 characters1
7+ characters2
QueryTerm lengthExample note contentMatches?Why
cat3a bright red carNoNo edits are allowed below 4 characters, so cat does not reach car
carr4a blue debit cardYes1 edit is within budget for 4–6 character terms
ceck4the latest tech trendsNoceck→tech needs 2 edits; only 1 is allowed at this length
combinef8the values were combined togetherYescombinef→combined is 1 edit; up to 2 are allowed at 7+ characters

Relevance ranking#

Rule: results are ordered by how well they match, not merely whether they match. Exact whole-word and phrase matches rank above substring and fuzzy matches, and a note where your words appear as a consecutive phrase outranks one where they are scattered.

QueryRanked higherRanked lowerWhy
syncplease sync the folderssynchronize the database nowexact word beats substring
you and meI like you and me as a phrasethe menu is here and you know itconsecutive phrase beats scattered words

What is searchable#

A search looks at more than the visible body text. All of the following are indexed and searchable:

  • note titles,
  • note body content,
  • labels and relations (attributes),
  • link URLs and the titles/descriptions of link previews,
  • the titles of notes that a note reference-links to.

The last point is the least obvious: if a note's only content is a reference link to another note, searching for that other note's title still finds the linking note.

QuerySetupMatches?Why
special topica note whose only content is a reference link to a note titled Special TopicYes, and the linked target ranks firstthe target's title is indexed into the linking note's searchable text
specialthe same note (only a reference link to Special Topic)Yes, one word from the target's title is enoughthe indexed title is normalized just like body text, so even one lowercased word matches
zuricha note whose only content is a reference link to a note titled ZürichYesthe indexed title has its accents normalized, so the plain form matches the accented title

Diacritics#

Rule: accents are normalized on both sides, so an accented word and its plain form match each other.

QueryExample note contentMatches?
ktoryslovo ktorý znamena niecoYes
ktorýthe word ktory appears hereYes

Regular expressions (%=)#

Rule: the %= operator matches a property or label value against a regular expression.

QueryExample note contentMatches?
note.content %= 'colou?r'my favorite color of allYes
note.content %= 'colou?r'my favourite colour of allYes