Search nodes give you the power to find anything, anywhere in Tana. They are easy to make, and can exist anywhere you can add a node. The many search operators available put advanced tools in your hands to create very specific searches according to your needs.
Search nodes retrieve nodes from any workspace you have access to. Results show up as references to nodes. Editing these nodes will edit the original and every reference of it.
What a search node retrieves is based on the search query. The query specifies what you are looking for, and is made in the Query builder.
Search nodes have a magnifying glass as a bullet icon. So they're recognizable even when collapsed.
Search nodes run queries on your Tana data. Examples of queries include:
Look for recipes with specific ingredients: Find all nodes tagged #recipes with the field Ingredient==Tomatoes, Peppers
Look for filled-out Feedback fields under a draft: Find all nodes with field Feedback==Set that is descendant of the node Q4 workplan draft
Look for unfinished tasks with a date older than a specific date: Find nodes tagged #todo that is NOT DONE, and with a date that is older (less) than January 10
Queries are composed in the Query builder. The builder uses search operators that come in the form of Tana objects. All operators are listed here: Search operators. For an explainer on how to read queries, check out this article.
Search nodes only run when expanded. This means they are not running live in the background while collapsed.
You can add nodes via the list of results. These nodes end up on the daily page of the workspace the search node lives in. It will try to create a node that follows the conditions of the query. If it isn't able to, it will show as a "mismatch".
You can add a view to a search node. You can apply views to all nodes that have children, including search nodes.
Returned results are limited to a maximum of 2500 nodes. If you run searches that return more than 2500 nodes, it will not run and you'll be prompted to change your query to narrow your search even further.
The entire query is wrapped in an AND operator, so by default every search criteria on the the query will return results that match every condition. For example, the screenshot below is looking for all nodes tagged #todo, AND it has to be NOT DONE, AND with a date that is older (less) than January 10 . Nodes have to meet all criteria listed.
Tana objects that can be used in the query builder:
OPERATOR
DESCRIPTION
LINTER
A reference
Inserting a reference will return only descendants of the reference. Tip: Reference a Workspace to limit results to nodes that live in that Workspace only.
DescendantOf:nodeName
A supertag
Inserting a supertag reference will return only instances of that supertag. Type # and a list of supertags will pop up.
Tag:tagName
A field definition
Inserting a field definition will return only nodes that have this field, and a value set for it.
hasField:fieldName
A field with one or more values
Inserting one or more plain text or reference values in a field will return nodes with this field that contain any of these values.
fieldName==Hello world
A plain text node
Inserting a plain text node that is not a reference will return nodes that match the text.
StringMatch:"hello world"
A node with a date
Inserting a date will return nodes whose name contains a date
DateWithin:date
A regular expression between /.../
Inserting a regular expression between the two forward slashes will return nodes that match the regular expression.
All of the clauses in the field values should match. AND is implied at the top level of the query builder as well.
AND
>OR
Any of the clauses in the field values should match.
OR
>NOT
Negates a single clause (if you want to negate multiple, you need multiple NOT statements).
NOT
>LT
LT = Less than. The LT field value should be the field you want to query with a field value (a number/date). This finds nodes that have a value less than the value provided. Also works with dates.
fieldName < fieldValue
>GT
GT = Greater than. The GT field value should be the field you want to query with a field value (a number/date). This finds nodes that have a value greater than than the value provided. Also works with dates.
fieldName > fieldValue
>LINKS TO
The LINKS TO operator finds all nodes that link to the reference in the field value. Only takes references or PARENT/GRANDPARENT. Similar to what is shown in a node's reference section.
LinksTo:nodeName
>CHILD OF
If the field value is a reference, the CHILD OF operator finds nodes/references that are children of the reference. If the field value is a field definition, the operator finds nodes/references that are children of this field.
ChildOf:nodeName
>OWNED BY
The OWNED BY operator finds nodes that are children of and owned by the reference in the field value.
OwnedBy:nodeName
>DATE OVERLAPS
Matches a date range that overlaps with the date provided
A keyword that finds all nodes with a checkbox, regardless if it is checked or not.
is:Todo
DONE
A keyword that finds any checked todos.
is:Done
DONE LAST [num] DAYS
A keyword that finds any todos that were manually checked within a certain number of days. Replace [num] with a number. Example: DONE LAST 7 DAYS.
DONE LAST 3 DAYS
NOT DONE
A keyword that finds any "not done" nodes, and unchecked todos. Combine with TODO to only find unchecked todos.
NOT is:Done
OVERDUE
An old keyword that finds any unchecked todos 1. using the system-defined Due Date field, and 2. with a date value that is older than today's date. For a more robust overdue search query, see Examples section below.
A keyword that finds any nodes created within a certain number of days. Replace [num] with a number. Example: CREATED LAST 7 DAYS.
CREATED LAST 3 DAYS
EDITED BY [user email] LAST [num] DAYS
A keyword that finds any nodes modified by a Tana user within a certain number of days. Replace [user email] with the email of the workspace member, and [num] with a number. Example: MODIFIED BY olaf@tana.inc LAST 7 DAYS.
EDITED BY USER@TANA.COM LAST 3 DAYS
EDITED BY [user email] ANYTIME
A keyword that finds all nodes modified by a Tana user. Example: MODIFIED BY olaf@tana.inc ANYTIME.
EDITED BY USER@TANA.COM ANYTIME
EDITED LAST [num] DAYS
A keyword that finds all nodes edited within a certain number of days relative to today. Example: EDITED LAST 7 DAYS.
Use in any field. Inserts the parent node relative to the search node. Useful for finding nodes with fields that use the parent/grandparent node as a field value, such as every #author node finding all #books they're the >Author of.
fieldName==parentnodeName
GRANDPARENT
Use in any field. Inserts the grandparent node relative to the search node. Useful for finding nodes with fields that use the parent/grandparent node as a field value, such as every #author node finding all #books they're the >Author of.
fieldName==grandparentnodeName
FOR RELATIVE DATE [term]
Use in date fields only. Inserts a date relative to today. Valid terms: yesterday, today, tomorrow, last/this/next week, last/this/next month, NEW: last/this/next year. Example: FOR RELATIVE DATE next week.
Date==RelativeDate:term=yyyy-mm-dd [timezone]
"Set"
A system node you can use in any field. Finds nodes where this field exists and has a value.
fieldName==Set
"Not Set"
A system node you can use in any field. Finds nodes where this field does not exist, or has no value. Warning: will find many nodes.
fieldName==Not set
"Defined"
A system node you can use in any field. Finds nodes where a field is defined/used in a supertag template, but might still be empty.
HasField:fieldName
"Not Defined"
A system node you can use in any field. Finds nodes where a field is not defined/used in a supertag template, or does not exist. Warning: will find many nodes.
Other than inserting the parent/grandparent node relative to the search node, these values have additional features that apply to fields and dates:
They can point to a field on the P/GP node using dot notation.
Example 1: PARENT.Description will point at the Description field on the parent.
Example 2: On a meeting node you could have a search to find other meetings for the related project of this meeting:
#meeting
>Related project==PARENT.Related project
They can be used for date comparisons under any calendar node
Using PARENT in a search node under a week or year node can now be used for date comparisons such as “find all tasks completed this week”. These date items will get the right granularity (day vs. week/month/year)
Also, PARENT that points at a date or a day/week/year node can do simple arithmetic. PARENT-7 on a day node would get the day 7 days earlier, PARENT+3 on a week node will get a date 3 weeks in the future.
Dot notation and date arithmetic can be combined in a field value
You can combine fields with date arithmetic, so PARENT.Due date+3 will be replaced with a date 3 days ahead of the date in the Due date field.
Our Navigators have created a Tana Template full of search examples that allow you to interact with many of the operators below to see how they work. They cover the basics and will continuously be updated as we surface more useful examples from the community. Click below to save the resource in one of your Tana workspaces (opens a new tab):
In the query builder, see marker 4 for the location of the linter.
The linter uses simple "code" to display the query logic without the fluff of the query builder interface.
By reading the output of the linter, you'll be able to tell if your query is configured as intended or not.
You'll know because all search operators show up in the linter in very specific ways. For instance, the linter will often "transform" from one state to the other as you're adding or typing out the operators. These provide clear clues on whether the operators are correctly setup or not.
See the column "Linter" in the list of search operators for what they should appear like in the linter if properly added.
Tana will return results up to 2500 nodes. It is recommended to add more clauses to narrow down the results, and here are a couple of different ways of doing it:
Limit by text match: Type the text you want to find and it will filter the results based on node name match. This shows up as (StringMatch: "xyz")
Limit by most recently created/edited: Type CREATED/EDITED LAST X DAYS to only get nodes that have been recently created/edited.
Limit by field value: A Status field can help you get only tasks that are Next up; an Attendees field can help you find all meetings that had a specific #person in them; a Dietary restriction field can find all your vegetarian recipes.
Put a search node in a day supertag template that has a field referencing the PARENT (will show up as "Date: Today, Wed, Oct 18" in linter). This will create searches that find nodes with dates that refer to that day like events, tasks, birthdays.
Put a search node in a supertag template that has a field referencing the PARENT (will show up as INSTANCE in the linter). This will make searches adapt based on the instance. Example: a #person supertag with a search node that looks for all meetings where this #person has attended.
If your #tasks have checkboxes and a date field that signifies a due/do date, or deadline, you can build a query in your daily page (important) to find all tasks that are 1. unchecked, and 2. older than today. It will look like this:
How can I find all nodes that have a specific word?
Sep 26, 2024
Should I use the DUE DATE field?
Sep 26, 2024
What is the difference between the Owner and a Parent of a node?
Sep 26, 2024
How can I search for content that is nested within one or more nodes?
Mar 07, 2024
I need help with date search! How do I do X?
Feb 13, 2024
How can I retrieve tasks dated for today?
Jan 17, 2024
Examples
What is the difference between the field operator CHILD OF and the keyword operator PARENTS DESCENDANTS
Sep 26, 2024
The search operators CHILD OF and PARENTS DESCENDANTS are similar, but have some key differences:
With CHILD OF, the target node is the node that you reference in it, and the results will only be direct children of the referenced node, including references
With PARENTS DESCENDANTS, the target node is the parent relative to the search node, and the results will match any descendant (children, grandchildren, great grandchildren etc.) of the target node, ignoring reference nodes
With PARENTS DESCENDANTS WITH REFS, the same as PARENTS DESCENDANTS except it includes reference nodes.
How can I get the Task list on my daily notes (back again)?
Sep 26, 2024
You may have seen a Tana setup that had a task list on the daily notes page, or even had one from early prototypes from us, and it somehow disappeared now.
There is a simple way to get it back.
Go to any daily note, and make a search that looks for:
all #task nodes
NOT DONE
Run it to confirm it's fetching the right things.
Adjust how you want your tasks to look (Set all view options here, like Display, Group, Sort options)
Confirm changes to the view options and the query. Right-click on the title of the search, and select Move to Related content.
While there isn't a search operator to target URL nodes, they all use a system-defined node to store the URL. You can grab the field definition for it in one of the URLs. and it will retrieve all nodes that use this field, which will be mostly URL nodes.
Note that the pasting of the URL search node into the search is to limit the search to only children within that node.