Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(docs): document basic search functionality
Elian Doran2e48837c891f
diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.jsonindex 7e724502ce..b6647c8bd3 100644--- a/docs/User Guide/!!!meta.json+++ b/docs/User Guide/!!!meta.json@@ -3523,6 +3523,83 @@"value": "bx bx-search-alt-2","isInheritable": false,"position": 30+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "xYmIYSP6wE3F",+ "isInheritable": false,+ "position": 40+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "YtSN43OrfzaA",+ "isInheritable": false,+ "position": 50+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "OR8WJ7Iz9K4U",+ "isInheritable": false,+ "position": 60+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "9sRHySam5fXb",+ "isInheritable": false,+ "position": 70+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "m523cpzocqaD",+ "isInheritable": false,+ "position": 80+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "wX4HbRucYSDD",+ "isInheritable": false,+ "position": 90+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "6f9hih2hXXZk",+ "isInheritable": false,+ "position": 100+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "MKmLg5x6xkor",+ "isInheritable": false,+ "position": 110+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "qzNzp9LYQyPT",+ "isInheritable": false,+ "position": 120+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "ivYnonVFBxbQ",+ "isInheritable": false,+ "position": 130+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "oPVyFC7WL2Lp",+ "isInheritable": false,+ "position": 140}],"format": "markdown",diff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search.mdindex f434850b08..fe7e029f66 100644--- a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search.md+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Search.md@@ -1,11 +1,59 @@# Search<figure class="image"><img style="aspect-ratio:987/725;" src="Search_image.png" width="987" height="725"></figure>-## Note Search-Note search enables you to find notes by searching for text in the title, content, or [attributes](../../Advanced%20Usage/Attributes.md) of the notes. You also have the option to save your searches, which will create a special search note which is visible on your navigation tree and contains the search results as sub-items.-To search for notes, click on the magnifying glass icon on the toolbar or press the <kbd>Ctrl</kbd> + <kbd>S</kbd> keyboard [shortcut](../Keyboard%20Shortcuts.md).+## Accessing the search++* From the <a class="reference-link" href="../UI%20Elements/Launch%20Bar.md">Launch Bar</a>, look for the dedicated search button.+* To limit the search to a note and its children, select _Search from subtree_ from the <a class="reference-link" href="../UI%20Elements/Note%20Tree/Note%20tree%20contextual%20menu.md">Note tree contextual menu</a> or press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd>.++## Interaction++To search for notes, click on the magnifying glass icon on the toolbar or press the keyboard [shortcut](../Keyboard%20Shortcuts.md).++1. Set the text to search for in the _Search string_ field.+ 1. Apart from searching for words ad-literam, there is also the possibility to search for attributes or properties of notes.+ 2. See the examples below for more information.+2. To limit the search to a note and its sub-children, set a note in _Ancestor_.+ 1. This value is also pre-filled if the search is triggered from a [hoisted note](Note%20Hoisting.md) or a [workspace](Workspaces.md).+ 2. To search the entire database, keep the value empty.+3. To limit the search to only a few levels of hierarchy (e.g. look in sub-children but not in sub-sub-children of a note), set the _depth_ field to one of the provided values.+4. In addition to that, the search can be configured via the _Add search options_ buttons, as described in the follow-up section.+5. Press _Search_ to trigger the search. The results are displayed below the search configuration pane.+6. The _Search & Execute actions_ button is only relevant if at least one action has been added (as described in the section below).+7. The _Save to note_ will create a new note with the search configuration. For more information, see <a class="reference-link" href="../../Note%20Types/Saved%20Search.md">Saved Search</a>.++## Search options++Click on which search option to apply from the Add search option section.++* For each search option selected, the search configuration will update to reveal the entry. Each search option will have its own configuration.+* To remove a search option, simply press the X button to the right of it.++The options available are:++1. Search script+ 1. This feature allows writing a <a class="reference-link" href="../../Note%20Types/Code.md">Code</a> note that will handle the search on its own.+2. Fast search+ 1. The search will not look into the content of the notes, but it will still look into note titles and attributes, relations (based on the search query).+ 2. This method can speed up the search considerably for large [databases](../../Advanced%20Usage/Database.md).+3. Include archived+ 1. <a class="reference-link" href="../Notes/Archived%20Notes.md">Archived Notes</a> will also be included in the results, whereas otherwise they would be ignored.+4. Order by+ 1. Allows changing the criteria for ordering the results, for example to order by creation date or alphabetically instead of by relevancy (default).+ 2. It's also possible to change the order (ascending or descending) of the results.+5. Limit+ 1. Limits the results to a given maximum.+ 2. This can help if the number of results would otherwise be high, at the cost of not being able to view all the results.+6. Debug+ 1. This will print additional information in the server log (see <a class="reference-link" href="../../Troubleshooting/Error%20logs.md">Error logs</a>), regarding how the search expression was parsed.+ 2. This function is especially useful after understanding the search functionality in detail, in order to determine why a complex search query is not working as expected.+7. Action+ 1. Apart from just searching, it is also possible to apply actions such as to add a label or a relation to the notes that have been matched by the search.+ 2. Unlike other search configurations, here it's possible to apply the same action multiple times (i.e. in order to be able to apply multiple labels to notes).+ 3. The actions given are the same as the ones in <a class="reference-link" href="../../Advanced%20Usage/Bulk%20Actions.md">Bulk Actions</a>, which is an alternative for operating directly with notes within the <a class="reference-link" href="../UI%20Elements/Note%20Tree.md">Note Tree</a>.+ 4. After defining the actions, first press _Search_ to check the matched notes and then press _Search & Execute actions_ to trigger the actions.### Simple Note Search Examplesdiff --git a/src/public/app/doc_notes/en/User Guide/!!!meta.json b/src/public/app/doc_notes/en/User Guide/!!!meta.jsonindex 5956cd216f..1fdde0cea1 100644--- a/src/public/app/doc_notes/en/User Guide/!!!meta.json+++ b/src/public/app/doc_notes/en/User Guide/!!!meta.json@@ -3523,6 +3523,83 @@"value": "bx bx-search-alt-2","isInheritable": false,"position": 30+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "xYmIYSP6wE3F",+ "isInheritable": false,+ "position": 40+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "YtSN43OrfzaA",+ "isInheritable": false,+ "position": 50+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "OR8WJ7Iz9K4U",+ "isInheritable": false,+ "position": 60+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "9sRHySam5fXb",+ "isInheritable": false,+ "position": 70+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "m523cpzocqaD",+ "isInheritable": false,+ "position": 80+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "wX4HbRucYSDD",+ "isInheritable": false,+ "position": 90+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "6f9hih2hXXZk",+ "isInheritable": false,+ "position": 100+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "MKmLg5x6xkor",+ "isInheritable": false,+ "position": 110+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "qzNzp9LYQyPT",+ "isInheritable": false,+ "position": 120+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "ivYnonVFBxbQ",+ "isInheritable": false,+ "position": 130+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "oPVyFC7WL2Lp",+ "isInheritable": false,+ "position": 140}],"format": "html",diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Navigation/Search.html b/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Navigation/Search.htmlindex 74ff9a57df..8d02358afc 100644--- a/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Navigation/Search.html+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Navigation/Search.html@@ -17,14 +17,121 @@<img style="aspect-ratio:987/725;" src="Search_image.png" width="987"height="725"></figure>- <h2>Note Search</h2><p>Note search enables you to find notes by searching for text in the title,content, or <a href="#root/_help_zEY4DaJG4YT5">attributes</a> of the notes.You also have the option to save your searches, which will create a specialsearch note which is visible on your navigation tree and contains the searchresults as sub-items.</p>+ <h2>Accessing the search</h2>+ <ul>+ <li>From the <a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_xYmIYSP6wE3F">Launch Bar</a>,+ look for the dedicated search button.</li>+ <li>To limit the search to a note and its children, select <em>Search from subtree</em> from+ the <a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/oPVyFC7WL2Lp/_help_YtSN43OrfzaA">Note tree contextual menu</a> or+ press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd>.</li>+ </ul>+ <h2>Interaction</h2><p>To search for notes, click on the magnifying glass icon on the toolbar- or press the <kbd>Ctrl</kbd> + <kbd>S</kbd> keyboard <a href="#root/_help_A9Oc6YKKc65v">shortcut</a>.</p>+ or press the keyboard <a href="#root/_help_A9Oc6YKKc65v">shortcut</a>.</p>+ <ol>+ <li>Set the text to search for in the <em>Search string</em> field.+ <ol>+ <li>Apart from searching for words ad-literam, there is also the possibility+ to search for attributes or properties of notes.</li>+ <li>See the examples below for more information.</li>+ </ol>+ </li>+ <li>To limit the search to a note and its sub-children, set a note in <em>Ancestor</em>.+ <ol>+ <li>This value is also pre-filled if the search is triggered from a <a href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/wArbEsdSae6g/_help_OR8WJ7Iz9K4U">hoisted note</a> or+ a <a href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/wArbEsdSae6g/_help_9sRHySam5fXb">workspace</a>.</li>+ <li>To search the entire database, keep the value empty.</li>+ </ol>+ </li>+ <li>To limit the search to only a few levels of hierarchy (e.g. look in sub-children+ but not in sub-sub-children of a note), set the <em>depth</em> field to one+ of the provided values.</li>+ <li>In addition to that, the search can be configured via the <em>Add search options</em> buttons,+ as described in the follow-up section.</li>+ <li>Press <em>Search</em> to trigger the search. The results are displayed below+ the search configuration pane.</li>+ <li>The <em>Search & Execute actions</em> button is only relevant if at+ least one action has been added (as described in the section below).</li>+ <li>The <em>Save to note</em> will create a new note with the search configuration.+ For more information, see <a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_m523cpzocqaD">Saved Search</a>.</li>+ </ol>+ <h2>Search options</h2>+ <p>Click on which search option to apply from the Add search option section.</p>+ <ul>+ <li>For each search option selected, the search configuration will update+ to reveal the entry. Each search option will have its own configuration.</li>+ <li>To remove a search option, simply press the X button to the right of it.</li>+ </ul>+ <p>The options available are:</p>+ <ol>+ <li>Search script+ <ol>+ <li>This feature allows writing a <a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_6f9hih2hXXZk">Code</a> note+ that will handle the search on its own.</li>+ </ol>+ </li>+ <li>Fast search+ <ol>+ <li>The search will not look into the content of the notes, but it will still+ look into note titles and attributes, relations (based on the search query).</li>+ <li>This method can speed up the search considerably for large <a href="#root/pOsGYCXsbNQG/tC7s2alapj8V/_help_wX4HbRucYSDD">databases</a>.</li>+ </ol>+ </li>+ <li>Include archived+ <ol>+ <li><a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/BFs8mudNFgCS/_help_MKmLg5x6xkor">Archived Notes</a> will+ also be included in the results, whereas otherwise they would be ignored.</li>+ </ol>+ </li>+ <li>Order by+ <ol>+ <li>Allows changing the criteria for ordering the results, for example to+ order by creation date or alphabetically instead of by relevancy (default).</li>+ <li>It's also possible to change the order (ascending or descending) of the+ results.</li>+ </ol>+ </li>+ <li>Limit+ <ol>+ <li>Limits the results to a given maximum.</li>+ <li>This can help if the number of results would otherwise be high, at the+ cost of not being able to view all the results.</li>+ </ol>+ </li>+ <li>Debug+ <ol>+ <li>This will print additional information in the server log (see + <a+ class="reference-link" href="#root/pOsGYCXsbNQG/BgmBlOIl72jZ/_help_qzNzp9LYQyPT">Error logs</a>), regarding how the search expression was parsed.</li>+ <li>This function is especially useful after understanding the search functionality+ in detail, in order to determine why a complex search query is not working+ as expected.</li>+ </ol>+ </li>+ <li>Action+ <ol>+ <li>Apart from just searching, it is also possible to apply actions such as+ to add a label or a relation to the notes that have been matched by the+ search.</li>+ <li>Unlike other search configurations, here it's possible to apply the same+ action multiple times (i.e. in order to be able to apply multiple labels+ to notes).</li>+ <li>The actions given are the same as the ones in <a class="reference-link"+ href="#root/pOsGYCXsbNQG/tC7s2alapj8V/_help_ivYnonVFBxbQ">Bulk Actions</a>,+ which is an alternative for operating directly with notes within the + <a+ class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_oPVyFC7WL2Lp">Note Tree</a>.</li>+ <li>After defining the actions, first press <em>Search</em> to check the matched+ notes and then press <em>Search & Execute actions</em> to trigger the+ actions.</li>+ </ol>+ </li>+ </ol><h3>Simple Note Search Examples</h3><ul><li><code>rings tolkien</code>: Full-text search to find notes containing