You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search.md
+42-5Lines changed: 42 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,50 @@
3
3
4
4
The _Quick search_ function does a full-text search (that is, it searches through the content of notes and not just the title of a note) and displays the result in an easy-to-access manner.
5
5
6
-
The alternative to the quick search is the<aclass="reference-link"href="Search.md">Search</a>function, which opens in a dedicated tab and has support for advanced queries.
6
+
The alternative to the quick search is the<aclass="reference-link"href="Search.md">Search</a>function, which opens in a dedicated tab and has support for advanced queries.
7
7
8
-
For even faster navigation, it's possible to use<aclass="reference-link"href="Jump%20to.md">Jump to Note</a>which will only search through the note titles instead of the content.
8
+
For even faster navigation, it's possible to use<aclass="reference-link"href="Jump%20to.md">Jump to Note</a>which will only search through the note titles instead of the content.
9
9
10
10
## Layout
11
11
12
-
Based on the<aclass="reference-link"href="../UI%20Elements/Vertical%20and%20horizontal%20layout.md">Vertical and horizontal layout</a>, the quick search is placed:
12
+
Based on the<aclass="reference-link"href="../UI%20Elements/Vertical%20and%20horizontal%20layout.md">Vertical and horizontal layout</a>, the quick search is placed:
13
13
14
-
* On the vertical layout, it is displayed right above the <aclass="reference-link"href="../UI%20Elements/Note%20Tree.md">Note Tree</a>.
15
-
* On the horizontal layout, it is displayed in the <aclass="reference-link"href="../UI%20Elements/Launch%20Bar.md">Launch Bar</a>, where it can be positioned just like any other icon.
14
+
* On the vertical layout, it is displayed right above the <aclass="reference-link"href="../UI%20Elements/Note%20Tree.md">Note Tree</a>.
15
+
* On the horizontal layout, it is displayed in the <aclass="reference-link"href="../UI%20Elements/Launch%20Bar.md">Launch Bar</a>, where it can be positioned just like any other icon.
16
+
17
+
## Search Features
18
+
19
+
Quick search includes the following features:
20
+
21
+
### Content Previews
22
+
Search results now display a 200-character preview of the note content below the note title. This preview shows the context where your search terms appear, making it easier to identify the right note without opening it.
23
+
24
+
### Infinite Scrolling
25
+
Results are loaded progressively as you scroll:
26
+
- Initial display shows 15 results
27
+
- Scrolling near the bottom automatically loads 10 more results
28
+
- Continue scrolling to load all matching notes
29
+
30
+
### Visual Features
31
+
-**Highlighting**: Search terms appear in bold with accent colors
32
+
-**Separation**: Results are separated with dividers
33
+
-**Theme Support**: Highlighting colors adapt to light/dark themes
34
+
35
+
### Search Behavior
36
+
Quick search uses progressive search:
37
+
1. Shows exact matches first
38
+
2. Includes fuzzy matches when exact results are fewer than 5
39
+
3. Exact matches appear before fuzzy matches
40
+
41
+
### Keyboard Navigation
42
+
- Press `Enter` to open the first result
43
+
- Use arrow keys to navigate through results
44
+
- Press `Escape` to close the quick search
45
+
46
+
## Using Quick Search
47
+
48
+
1.**Typo tolerance**: Search finds results despite minor typos
49
+
2.**Content previews**: 200-character snippets show match context
50
+
3.**Infinite scrolling**: Additional results load on scroll
51
+
4.**Specific terms**: Specific search terms return more focused results
52
+
5.**Match locations**: Bold text indicates where matches occur
Copy file name to clipboardExpand all lines: docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search.md
+60-3Lines changed: 60 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,11 +66,25 @@ The options available are:
66
66
*`#book #publicationYear = 1954`: Find notes with the "book" label and "publicationYear" set to 1954.
67
67
*`#genre *=* fan`: Find notes with the "genre" label containing the substring "fan". Additional operators include `*=*` for "contains", `=*` for "starts with", `*=` for "ends with", and `!=` for "is not equal to".
68
68
*`#book #publicationYear >= 1950 #publicationYear < 1960`: Use numeric operators to find all books published in the 1950s.
69
-
*`#dateNote >= TODAY-30`: A "smart search" to find notes with the "dateNote" label within the last 30 days. Supported smart values include NOW +- seconds, TODAY +- days, MONTH +- months, YEAR +- years.
69
+
*`#dateNote >= TODAY-30`: Find notes with the "dateNote" label within the last 30 days. Supported date values include NOW +- seconds, TODAY +- days, MONTH +- months, YEAR +- years.
70
70
*`~author.title *=* Tolkien`: Find notes related to an author whose title contains "Tolkien".
71
71
*`#publicationYear %= '19[0-9]{2}'`: Use the '%=' operator to match a regular expression (regex). This feature has been available since Trilium 0.52.
72
72
*`note.content %= '\\d{2}:\\d{2} (PM|AM)'`: Find notes that mention a time. Backslashes in a regex must be escaped.
73
73
74
+
### Fuzzy Search
75
+
76
+
Trilium supports fuzzy search operators that find results with typos or spelling variations:
77
+
78
+
*`#title ~= trilim`: Fuzzy exact match - finds notes with titles like "Trilium" even if you typed "trilim" (with typo)
79
+
*`#content ~* progra`: Fuzzy contains match - finds notes containing words like "program", "programmer", "programming" even with slight misspellings
80
+
*`note.content ~* develpment`: Will find notes containing "development" despite the typo
81
+
82
+
**Important notes about fuzzy search:**
83
+
- Fuzzy search requires at least 3 characters in the search term
84
+
- Maximum edit distance is 2 characters (number of character changes needed)
85
+
- Diacritics are normalized (e.g., "café" matches "cafe")
86
+
- Fuzzy matches work best for finding content with minor typos or spelling variations
87
+
74
88
### Advanced Use Cases
75
89
76
90
*`~author.relations.son.title = 'Christopher Tolkien'`: Search for notes with an "author" relation to a note that has a "son" relation to "Christopher Tolkien". This can be modeled with the following note structure:
@@ -117,6 +131,32 @@ Some queries can only be expressed with negation:
117
131
118
132
This query finds all book notes not in the "Tolkien" subtree.
119
133
134
+
## Progressive Search Strategy
135
+
136
+
Trilium uses a progressive search strategy that performs exact matching first, then adds fuzzy matching when needed.
137
+
138
+
### How Progressive Search Works
139
+
140
+
1.**Phase 1 - Exact Matching**: When you search, Trilium first looks for exact matches of your search terms. This handles the vast majority of searches (90%+) and returns results almost instantly.
141
+
142
+
2.**Phase 2 - Fuzzy Fallback**: If Phase 1 doesn't find enough high-quality results (fewer than 5 results with good relevance scores), Trilium automatically adds fuzzy matching to find results with typos or spelling variations.
143
+
144
+
3.**Result Ordering**: Exact matches always appear before fuzzy matches, regardless of individual scores. This ensures that when you search for "project", notes containing the exact word "project" will appear before notes containing similar words like "projects" or "projection".
145
+
146
+
### Progressive Search Behavior
147
+
148
+
-**Speed**: Most searches complete using only exact matching
149
+
-**Ordering**: Exact matches appear before fuzzy matches
150
+
-**Fallback**: Fuzzy matching activates when exact matches return fewer than 5 results
151
+
-**Identification**: Results indicate whether they are exact or fuzzy matches
152
+
153
+
### Search Performance
154
+
155
+
Search system specifications:
156
+
- Content size limit: 10MB per note (previously 50KB)
157
+
- Edit distance calculations for fuzzy matching
158
+
- Infinite scrolling in Quick Search
159
+
120
160
## Under the Hood
121
161
122
162
### Label and Relation Shortcuts
@@ -142,7 +182,7 @@ However, common label and relation searches have shortcut syntax:
142
182
143
183
### Separating Full-Text and Attribute Parts
144
184
145
-
Search syntax allows combining full-text search with attribute-based search seamlessly. For example, `tolkien #book` contains:
185
+
Search syntax allows combining full-text search with attribute-based search. For example, `tolkien #book` contains:
146
186
147
187
1. Full-text tokens - `tolkien`
148
188
2. Attribute expressions - `#book`
@@ -181,4 +221,21 @@ This finds notes created in May 2019. Numeric operators like `#publicationYear >
181
221
182
222
You can open Trilium and automatically trigger a search by including the search [url encoded](https://meyerweb.com/eric/tools/dencoder/) string in the URL:
Copy file name to clipboardExpand all lines: docs/User Guide/User Guide/FAQ.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,4 +54,27 @@ More detailed answer:
54
54
* files are stored in no particular order and user can't change this
55
55
* Trilium allows storing note [attributes](Advanced%20Usage/Attributes.md) which could be represented in extended user attributes but their support differs greatly among different filesystems / operating systems
56
56
* Trilium makes links / relations between different notes which can be quickly retrieved / navigated (e.g. for [note map](Advanced%20Usage/Note%20Map%20\(Link%20map%2C%20Tree%20map\).md)). There's no such support in file systems which means these would have to be stored in some kind of side-car files (mini-databases).
57
-
* Filesystems are generally not transactional. While this is not completely required for a note-taking application, having transactions make it way easier to keep notes and their metadata in predictable and consistent state.
57
+
* Filesystems are generally not transactional. While this is not completely required for a note-taking application, having transactions make it way easier to keep notes and their metadata in predictable and consistent state.
58
+
59
+
## Search-related Questions
60
+
61
+
### Why does search sometimes find results with typos?
62
+
63
+
Trilium uses a progressive search strategy that includes fuzzy matching when exact matches return fewer than 5 results. This finds notes despite minor typos in your search query. You can use fuzzy search operators (`~=` for fuzzy exact match and `~*` for fuzzy contains). See the <aclass="reference-link"href="Basic%20Concepts%20and%20Features/Navigation/Search.md">Search</a> documentation for details.
64
+
65
+
### How can I search for notes when I'm not sure of the exact spelling?
66
+
67
+
Use the fuzzy search operators:
68
+
-`#title ~= "projct"` - finds notes with titles like "project" despite the typo
69
+
-`note.content ~* "algoritm"` - finds content containing "algorithm" or similar words
70
+
71
+
### Why do some search results appear before others with lower scores?
72
+
73
+
Trilium places exact matches before fuzzy matches. When you search for "project", notes containing exactly "project" appear before notes with variations like "projects" or "projection", regardless of other scoring factors.
74
+
75
+
### How can I make my searches faster?
76
+
77
+
1. Use the "Fast search" option to search only titles and attributes (not content)
78
+
2. Limit search scope using the "Ancestor" field
79
+
3. Set a result limit to prevent loading too many results
80
+
4. For large databases, consider archiving old notes to reduce search scope
0 commit comments