Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Search syntax

The Browse search box, saved searches, custom study sessions (search kind) and insight links use Anki’s search syntax. The parser and SQL compiler are in crates/loci-core/src/search/.

Combining terms

You typeFinds
dog catnotes containing both dog and cat (AND is implicit)
dog and catthe same; and is optional
dog or cateither word
dog (cat or mouse)dog and either cat or mouse
-catnotes without cat
-(cat or mouse)notes with neither

and binds tighter than or, as in Anki: a b or c means (a and b) or c. Operators are case-insensitive.

Text

You typeFinds
dogdog anywhere in the note’s text (HTML removed), also inside doggy
"a dog"the exact phrase a dog; cloze markup is read as its text, so "Paris is in France" finds {{c1::Paris}} is in {{c2::France::country}}
d*g* matches any run of characters: dg, dog, dung
d_g_ matches one character: dog, dig
w:dogdog as a whole word (not doggy); w:dog* matches words starting with dog
nc:uberignores accents and other combining marks: matches über
re:(?i)^colou?ra regular expression on the raw field HTML of any field
sc:the cattext inside cloze deletions counts ({{c1::cat}} matches the cat)
\*, \_, \", \\, \:, \(, \), \-the literal character

Plain text searches are case-insensitive. Terms of three characters or more use the full-text index (fast, case-insensitive in every script, including Arabic and CJK); shorter terms and terms with wildcards use a scan that folds case for ASCII letters only, as Anki does.

Fields

You typeFinds
front:dogthe field named Front is exactly dog
front:*dog*Front contains dog
front:Front is empty
fr*:dogany field whose name starts with fr is exactly dog
front:re:^d.g$regular expression on Front
front:nc:uberFront equals uber, ignoring accents

Field searches match the field’s HTML, case-insensitively, one field at a time.

Decks, note types, cards, tags

You typeFinds
deck:Languagescards in Languages and all its subdecks
"deck:Languages::Arabic Verbs"quote names with spaces
deck:Lang*decks matching a wildcard
deck:currentthe deck you are studying or browsing from
-deck:Languages::Arabic::*excludes the subdecks of Arabic (not Arabic itself)
deck:*every card
deck:filteredcards still in a filtered deck (none after import: Loci returns them home)
preset:Standardcards in decks that use the Standard preset
note:Basicnotes of the note type Basic (wildcards allowed)
card:1the first card type of each note (cloze: card:3 is cloze 3)
card:Reversecards of the template named Reverse
tag:verbnotes tagged verb or any child tag (verb::irregular)
tag:verb*tags starting with verb
tag:nonenotes without tags
tag:re:^ar.*s$tags matching a regular expression

Card state

You typeFinds
is:duereviews and day-learning cards due today or earlier, and learning cards due now
is:newnew cards
is:learncards in (re)learning
is:reviewreview cards, including ones relearning after a lapse
is:suspendedsuspended cards
is:buriedburied cards; is:buried-sibling and is:buried-manually split them
flag:1red flag (2 orange, 3 green, 4 blue, 5 pink, 6 turquoise, 7 purple; flag:0 none)
tag:leechcards the scheduler marked as struggling

Properties

prop: compares a number with <, >, <=, >=, = or !=.

You typeFinds
prop:ivl>=30interval of at least 30 days
prop:due=1due tomorrow; prop:due<0 overdue; prop:due<=2 within two days
prop:reps>10, prop:lapses>=8answered more than 10 times; lapsed 8 times or more
prop:ease<2.0SM-2 ease under 200%
prop:pos<=100new cards at position 100 or earlier
prop:r<0.9FSRS retrievability (chance of recall now) below 90%, for every card with a memory state whatever its queue (review, learning, relearning, suspended, buried); days since the last review come from the card’s last-review time, else its due day, else its latest answer
prop:s>90FSRS stability over 90 days
prop:d>0.8FSRS difficulty above 80% (0–1 scale)
prop:rated=-1answered yesterday; prop:resched>-7 rescheduled in the last week
prop:cdn:key>5, prop:cds:key=valuecustom data written by Anki add-ons
has-cd:keycards that have that custom data key

Time

Days count back from the start of today (the day starts at the rollover hour, 4 am by default).

You typeFinds
rated:1answered today; rated:7 in the last week
rated:7:1answered Again in the last week (:2 Hard, :3 Good, :4 Easy)
added:1cards added today
edited:3notes edited in the last three days
introduced:30cards first studied in the last 30 days
resched:7cards rescheduled by hand (set due date, reset) in the last week

Identifiers

You typeFinds
nid:1700000000000a note by id; several: nid:1,2,3
cid:…, mid:…, did:…cards, note types, decks by id
dupe:1700000000000,dognotes of that note type whose first field is dog

Examples

  • Struggling cards in one deck: "deck:Medicine::Anatomy" (tag:leech or prop:lapses>=8)
  • What is at risk today: is:due prop:r<0.8
  • New Arabic verbs: deck:Languages::Arabic::Verbs is:new
  • Notes you edited this week that contain an image: edited:7 re:<img
  • Cards you forgot yesterday: rated:2:1 -rated:1

Differences from Anki

  • Field searches and re: see the field’s HTML; plain text searches see the text without HTML. This is also Anki’s behaviour. Unlike Anki, plain text searches also see cloze deletions as the text they reveal (markers and hints removed), so a phrase can span a cloze boundary; search the markup itself with re: or a field search (text:*c1::*).
  • prop:r covers learning and relearning cards that have a memory state, not only review cards.
  • Filtered decks are not kept as decks in Loci, so deck:filtered normally finds nothing.
  • Searches that need a custom SQL function in Anki (fields, re:, nc:, w:, sc:, wildcard tags, dupe:) are evaluated in two steps: SQL narrows the candidates, then an exact check runs on each. The results are the same; very broad regular expressions on huge collections are slower.