Evan Harmon - Memex

Obsidian Searches & Queries

Saved Searches

Do a search, then change to the starred tab and there's an icon that says save current search
Or you could always do the inline query code block thing which is pretty neat.

Search Selected Text

  • Cmd-Shfit-F (same as search all files command)

Copy Search Results

Very useful feature - you can copy search results as text - ie, a list of markdown links easily pasted anywhere.
Also a plugin that basically uses that ability to embed that kind of functionality similar to an embedded dataview query - Obsidian Expander Plugin

Boolean

  • OR, AND, ()

Exact phrase with quotes ""

Operators

Search operator Description
file: Find text in filename. Matches any file in the vault.

Example: file:.jpg or file:202209.
path: Find text in file path. Matches any file in the vault.

Example: path:"Daily notes/2022-07".
content: Find text in file content.

Example: content:"happy cat".
match-case: Case-sensitive match.

Example: match-case:HappyCat.
ignore-case: Case-insensitive match.

Example: ignore-case:ikea.
tag: Find tag in file.

Example: tag:#work.

Note: Since tag: ignores matches in code blocks and in non-Markdown content, it's often faster and more accurate than a normal full-text search for #work.
line: Find matches on the same line.

Example: line:(mix flour).
block: Find matches in the same block.

Example: block:(dog cat).

Note: Since block: requires Search to parse the Markdown content in every file, it can cause your search term to take longer time to finish.
section: Find matches in the same section (text between two headings).

Example: section:(dog cat).
task: Find matches in a task on a block-by-block basis.

Example: task:call.
task-todo: Find matches in an uncompleted task on a block-by-block basis.

Example: task-todo:call.
task-done: Find matches in a completed task on a block-by-block basis.

Example: task-done:call.

Properties

  • [aliases:Name] returns files where the aliases property value is Name
  • Both property and value allow sub-queries, such as parentheses for grouping, the OR operator, double-quotes for exact matching, and regex.
    • Example: [status:Draft OR Published] to find returns files where the status property value is Draft or Published

Example - Return notes that contain a tag in the tags property

[tags:view/node]

Results

  • Copy search results option
  • Expander plugin

Use regular expressions

Surround the expression with forward slashes (/)

/\d{4}-\d{2}-\d{2}/ matches an ISO 8601 date, such as 2022-01-01.
You can even combine regular expressions with search operators:

path:/\d{4}-\d{2}-\d{2}/ returns files with a date in the file path.
For more information on how to write regular expressions, refer to Regular expressions

Note
Regular expressions come in different flavors that may look different from each other. Obsidian uses JavaScript-flavored regular expressions.

Embedded Query

tag:#to

Examples

file:/^On / AND tag:#Type/Form

Obsidian Searches & Queries
Interactive graph
On this page
Obsidian Searches & Queries
Saved Searches
Search Selected Text
Copy Search Results
Boolean
Exact phrase with quotes ""
Operators
Properties
Example - Return notes that contain a tag in the tags property
Results
Use regular expressions
Embedded Query
Examples