Both beginners and experts often have something in common when it comes to PKM: they both lean heavily on search.
As your stockpile of notes grows, search becomes more and more important in your workflow. No matter how well you organize your notes, there will be times when the easiest way to find a note is to search for it.
The Obsidian Search plugin (a core plugin that comes with Obsidian) is incredible. It’s fast, comprehensive, and comes with tons of advanced features. Let’s learn more about this incredible tool!
Enable the Obsidian search plugin
First, if you haven’t already, you’ll need to enable the search plugin in order to use these features. The search plugin is a “core” plugin, which means it’s built-in to every copy of Obsidian, all you have to do is make sure it’s enabled. You can enable it by going to “Settings > Core Plugins”:
Find the item labeled “Search” and turn it on. Once Obsidian search is enabled, you should see a search icon in the upper left hand corner of Obsidian.
Standard search features… And some extras
There are a number of features that are included in Obsidian that I would consider “standard” search features. These are tools that you can use on virtually any search engine, and are somewhat expected. These are:
- Standard word search. Type in your terms and notes will appear that include any of the words you type. For example,
obsidian rockswill match any note that includes the word
rocks, but not necessarily in that order.
- Exact word search. If you add quotes to your query, e.g.
"obsidian rocks", then it will only match notes with that phrase. It treats that phrase essentially like a single word.
In addition to these examples, there are a couple of unusual features of this type of search:
- OR search: you can type
obsidian OR rocksto look for notes that include either the word
obsidianor the word
- Exclusionary search: you can type
obsidian -rocksto find notes that use the word
obsidianbut not the word
rocks. This is particularly useful for searches that use tags (more on that below).
These are great features to know about, and they’re easy to use and remember.
Search operators are “power user” features. They’re extremely handy if you remember to use them, but they can be hard to remember. Search operators allow you to do things like:
- Search for tags:
- Search for files:
- Search for content only (this excludes titles from the search): `content:”obsidian rocks”
- Search for tasks. You can search through all tasks with
task:, search for undone tasks with
task-todo:, and completed tasks with
- Search smaller chunks of text. You can search single lines with
line:(search term), blocks with
block:(search term), and sections with
section:(search term). Generally you would use multiple search terms with these, like
- Control case matching. You can include either
ignore-case:to tell Obsidian whether you want it to pay attention to capitalization or not.
There’s nothing better than search operators when you’re trying to find a needle in a haystack. You can also combine them to make incredibly precise queries, such as:
tag:#work task-todo:(account -freedom)
This is a search I ran in my own vault that searches for work tasks that are uncompleted and include the word “account” but not the word “tax”. Complicated, but useful.
Explain a search to you
If you’re messing around with search operators, then you might need this next tip.
If you’re working on a complex search query and it’s not quite working,
or if you forget why it works,
then Obsidian will happily tell you what it does! All you have to do is copy the search term into your search, and click the (?) icon. Obsidian will then explain the query to you:
This can be a lifesaver, especially if you rely on complex queries.
Other search settings
While we’re talking about those buttons above the search box, we should talk about what the rest of them do. They’re all search settings, and they change how your search results appear. Here’s what they are called and what they do:
|Match case||Toggles case-sensitive matching|
|Explain search term||Explains your search term in plain text|
|Collapse results||Toggles between the contents of your notes and only the titles|
|Show more context||Expands search results to show more text around each search result|
|Change sort order||Gives you a few different options for ordering your search resulets|
|Copy search results||Convert and copy your search results as a markdown list with optional links|
Some of these are useful and others I personally never use. Your mileage may vary, but it’s good to know that they’re there.
Embed search results in a note
This is one of my favorite “hidden” features. Search results don’t have to be confined to your sidebar: you can embed search results directly in your notes.
This is a bit like Dataview, but easier to use and less versatile. If you haven’t yet tried Dataview, or if it’s not for you, then embedded search results might give you just the right amount of dynamic content in your vault.
Embedding search couldn’t be much easier, here’s the syntax:
```query your search query ```
You can copy that into your vault or type it. The results will look something like this:
Like I said it is a bit limited, you can’t use any of the search settings that we discussed above. But you can use search operators, so your queries can be as complex as you’d like.
This feature gets an honorary mention from me. You can also use regular expressions when searching in Obsidian.
Regular expressions are essentially a whole programming language meant for searching. They’re pretty technical and tricky to use, but if you really need to find a needle in a thousand haystacks, regular expressions can do that for you. If you’re so inclined, you can learn more about them at the MDN.
Searching is an essential tool in any PKM, and Obsidian Search is one of the best tools we’ve seen in any note taking app. It’s flexible, powerful, and fast. It’s also easy to use. Usually a couple of words is all you need to find a note, but if you need to write more precise queries, all the tools are there for you.
This article is focused on the built-in search, but there are also numerous community plugins that give you more options for search. If the built-in plugin doesn’t do what you need, you might try looking for a community plugin. More on those coming soon.
Leave a Reply