#2 Tana Live Search for Beginners Series: Search Building Blocks and Execution Order
2023.06.03.v5 Edition
Thank you for your continued support. I'm on a mission to help the less tech-savvy community enjoy Tana's power. So please know your questions are always welcome. Whether you're a free subscriber or paid (thank you very much for your support!), don't hesitate to post your questions in SLACK, in our exclusive Substack subscribers-only Chat (including free subscribers), or DM me in SLACK or Twitter.
Index to Live Search Series for Beginners
Tana Live Search Beginner’s Series: Article #2
Edition Table of Contents:
Getting Started
Search Expression Building Blocks
Key:Value Concept
Minimum Requirments
Typical Requirements
Execution Order
Boolean Logic
Tana Logic
Logic Example
Wrap Up
Tana Announcements
New Resources
This is part two of a four-part series on Tana Live Search Series for Beginners. An index to the entire series is here.
We jump back into that Live Search series this week and continue deconstructing the Live Search Expression, discussing basic search building blocks, and search execution order.
Stay tuned for more in this series:
In Part Three, we will deconstruct the differences between System Nodes, System Fields, System Operators, and Value types
Finally, in Part Four, we will deconstruct the Search Keywords that can superpower your search.
Getting Started
The search expression is what goes into the Search Criteria area of the Search Expression Box (circled in RED in the image below):
A quick beginner's reminder: you don't have to use any of this! 🤣 But if you choose to, remember that even though this article shows you how to start from scratch, you don't have to.
You can use the CMD/CTRL k > FIND NODES... command line feature. This feature walks you through building a search, even those with multiple criteria.
I often start a search using the command line but only put in the basic requirements. Then I open up the search box and go from there. But regardless of which way you choose to create a search - it doesn't hurt to understand how they are built.
I'll refer to the red outlined search area as a grid for clarification and ease of reference throughout this article. This means I'll refer to rows and columns, as the diagram below shows:
This will enable me to reference a specific area and hopefully not add confusion! Like this:
Hashtag "Book" is in Row1, Col1
System operator "NOT" is in Row2, Col1
Plain text "1" is in Row 2a, Col4
Reference to "Charles Gilkey #author is in Row2b, Col4
Note that the example shows three rows and four columns, but the search expression is not limited to that. However, it's generally enough for most beginner searches.
Let's deconstruct the search expression.
1) Search Expression Building Blocks
KEY: VALUE concept
I'm going to reference the KEY:VALUE construct in this article. This is the basic search expression. It can be as simple as one supertag (a KEY) or as complex as multiple KEY:VALUE combinations where KEYs become VALUEs (sounds confusing, I know, but hang in there, we will break it down together).
Using our Grid references, the foundation for any expression usually includes:
KEY in Col1 and its VALUE in Col2
That said, a KEY is not always required, but a VALUE is. This is discussed below.
Examples:
1. Searching for the supertag #book
where the author is "Charlie Gilkey"
Key:Value = #book
: Charles Gilkey
Book is the key - and the value of that key you're searching for is "Charlie Gilkey"
2. In a slightly more complex search shown below
”OR” is the key with two values: “Subject” and “AND”
But then "Subject" becomes the key with a value of "Time Management"
And “AND” becomes the key with the values of “Page” and “LT”
and so on.
Thus, anything in Col1 is a KEY with its VALUE(s) in Col2
Then Col2 is also a KEY to the VALUE(s) in Col3
Then those values in Col3 become the KEY to the VALUE(s) in Col4
and so on...
Minimum Requirement for an Expression
Each row must contain at least one VALUE
A VALUE can be a supertag, field, or plain text.
Supertag:
A search can be as simple as one supertag reference, which results in a list of nodes that use that supertag. The example below searches of all nodes with the supertag “person.”
Field
If you enter JUST a field name using the ">" symbol and select it from the popup list- then your search will result in all nodes that INCLUDE that field. The search results below are identical to the search above because all nodes tagged “person” also include the field “role”.
If you list only the field name, like below, you’ll get all nodes with that field regardless if the field has a value or not. For this reason, this isn't a helpful search for beginners but listed here to demonstrate the point.
Further down in this article, you’ll see how using a field with a field value is much more useful (such as ROLE with a value of AUTHOR).
Plain text
If you enter plain text (meaning you just start typing text in the node), then Tana will return all nodes that include that word or phrase, without regard to its case, in the node’s name, description, field value, child node to the supertag, and subnode to a field value. Any deeper than that, and Tana will not find the plain text.
In the search below, we are looking for any node with the word “finish” in it.
This search will include any nodes in which “finish” is:
Part of the word (as in “finished”)
In the node’s title
In the node’s description
As a value for a field in a supertag
In a child node underneath the node
In other words, it looks for the word “finish” in whole or part, ANYWHERE in the node.
Another example - we are searching for the word “Tana” in the five examples below. Only two of them show up in the search. Notice #3-5 don’t appear because the word “Tana” is a subnode that isn’t searched by Tana.
Typical Requirements for an Expression
Most searches include one or more KEY:VALUE combinations, in one or more rows.
Initial KEYs
I'll refer to the first KEY in each row as the initial key. In the example above, we saw how a KEY's value can become a KEY itself - thus the specification of "initial KEY."
Initial KEYS can be SYSTEM OPERATORS, FIELDS, KEYWORDS, and WORKSPACE names.
System Operators
As you might remember from the previous article, SYSTEM OPERATORS include AND, OR, NOT, GT, LT, LINKED_TO, CHILD_OF, and OWNED_BY.
These operators can act as KEYs. Each is linked to the appropriate section of the previous article for reference.
👉 Beginner's hint:
Enter system operators using the buttons provided in the search box. This helps avoid mistakes
System Operators always require a VALUE
Fields
Fields are what you add to a supertag to structure your data.
Using a FIELD:VALUE combination equates to asking Tana to return all nodes that include the specified VALUE in the named FIELD.
So if you're looking for all nodes that mention "Charlie Gilkey #author," then your search expression looks like this:
Plain Text Keywords
Plain text keywords are values that are discussed in Part 4 of this series.
Workspace Names
Workspace is a KEY whose value is the name of the Workspace. Using Workspace:Name limits your search results to only those nodes in the named Workspace. See more details below under System Fields.
2) Execution Order
Understanding how Tana executes your search expression will help you understand how to build expressions.
But before we dive into that, let's talk about the basis for search execution.
Boolean Logic
The entire expression itself is based on Boolean Logic. It's one of those math/programming terms that may confuse some right-brain thinkers.
If you're new to Boolean Logic, it's nothing more than a game of True/False.
Let's say I ask you, "Is the sky blue?" You can answer "yes" or "no." That's a simple Boolean logic expression resulting in true (yes) or false (no).
Boolean logic uses words like "and," "or," and "not" (which TANA calls "OPERATORS") to combine or change questions. For example, if I ask you,
"Is it raining outside, and are you sick today?"
You have to answer "yes" only if it is both RAINING and YOU'RE SICK TODAY--both things have to be true for the KEY:VALUE combination to be TRUE.
In Boolean logic, the order of execution is based on a hierarchy of system operators and the use of parenthesis.
Tana Logic
In Tana search logic, the execution order is based on the location of the KEY:VALUE combination.
First, Tana looks at the instruction in the first row and evaluates each KEY:VALUE combination in a right-to-left order. Then it moves to the next row, and so on.
The right-most KEY:VALUE's TRUE / FALSE result is determined, then that is passed to the KEY:VALUE test to its left until the final KEY:VALUE TRUE/FALSE result is determined for the entire ROW.
And finally, each row's final TRUE/FALSE determination is combined (remember the implied AND requirement of all the rows?)to determine the Search Expressions final TRUE/FALSE result. If the final result is true - Tana includes the node in the search result; if FALSE, the node is not included.
Tana interprets what you enter into the search criteria area in what it calls the “Linter” Area of the search box, as shown below. Use this Linter to help you if you’re getting results that are unexpected.
PHEW WEEE, Dee, I'm MORE confused 🤷♀️ now than I was before!! HELP!!
Hang in there; an example might be in order.
Tana Logic Example
We will use the data below and create the search to illustrate Tana Logic.
We want to search for all books with no rating, or those rated 1 or 2.
#book
Rating Not set OR with a Rating of 1 or 2
Regardless of how complex the search is and how many Key:Value combinations are included --
each Key:VALUE combination results in either TRUE or FALSE
Each KEY:VALUE combination is evaluated from right-to-left in each row to determine the row’s TRUE / FALSE resolution
Then, each row's result is compared (via AND) with the other rows' results to determine whether Tana should include a node in the final results. Only those nodes that are TRUE in all rows will be included.
🤕 Beginner Headaches 🤕
IMPLIED "AND"
Everything on a new row is an implied AND with any other row.
This means the requirement(s) in Row1 AND Row2 AND Row3 MUST ALL be met for TANA to include a node in the search results.
In the example below, a node must
- be tagged book, AND
- it must include a field "Authors" with a value of "Charles Gilkey," AND
- it must have a field "Rating" with a value of "1"
All must be true for the node to appear in the results.
Using NOT operator
Another beginner headache is when you use the “NOT” operator. Here is an example:
As discussed, both items in Col 1 must be TRUE, so the node MUST be both:
Tagged as a book
AND
NOT have a rating of 1
In other words, Tana will not include any node-tagged book with a rating of 1 because of both the AND and the NOT operators (AND it must NOT have a rating of 1).
One row can have multiple requirements.
One row can have multiple criteria (multiple KEY:VALUE combinations).
Remember earlier when I said, "Tana will first look at the instruction in the first row and complete everything in that row from right-to-left."
Let's deconstruct the example below to illustrate this right-to-left execution order.
SEARCH: Find nodes tagged #book without a rating of 1, or not authored by Charlie Gilkey.
DATA: This is the data used in the above search:
Row1 Deconstructed
Row one asks Tana to search the graph for all nodes tagged #book.
All of the items in our above data set are tagged #book; thus, they would all be TRUE for this part of the search.
For our data:
Start Finishing = TRUE, ROW1
Atomic Habits = TRUE, ROW1
The Art of Now Glasses = TRUE, ROW1
Finished and Final = TRUE, ROW1
Now and Forever = TRUE, ROW1
So far, we have four nodes that MIGHT be included in the results, but before the final answer, we need to evaluate Row2 and then look at the results of each row compared to each other.
Row2 Deconstructed
Let's deconstruct Row2. Tana starts at the right-most KEY:VALUE criteria to evaluate the row.
Col #3, Row 2a and Row 2b
Whatever the result is of the KEY:VALUE criteria in Col2, Col3, and Col4 (everything to the right of the NOT) - will NOT be included in the results.
To evaluate that, we must first look at the right-most KEY:VALUE combination.
The right-most criteria in Row #2 has two parts:
2a Rating = 1
2B Authors = Charles Gilkey
And we must go back one more column to see the criteria is OR -- meaning the nodes must meet only ONE of the criteria (Rating or Author).
Tana looks to see if EITHER
Rating = 1
OR
Author = Charles Gilkey
if one is true - this section of the search is true.
Start Finishing doesn't have a rating of 1, but its author is Charles Gilkey. Since the OR operator requires only one criterion to be met - this node resolves to TRUE.
Atomic Habits has a rating of 1 but is not authored by Charles Gilkey. Again, since one criterion of the OR operator is met - this node also resolves to TRUE.
The Art of Now Glasses has a rating of 3 and is not authored by Charles Gilkey. Since it is NOT authored by Gilkey and it does not have a RATING of 1 - this node resolves to FALSE.
Finished and Final has no rating and is not authored by Charles Gilkey. Since its rating is not 1, and it is NOT authored by Gilkey - thus, neither of the OR criteria is met, so this node resolves to FALSE.
Now and Forever has a rating of 3 and is not authored by Charles Gilkey. Since its rating is not 1, and it is NOT authored by Gilkey - thus, neither of the OR criteria is met, so this node resolves to FALSE.
For our data:
Start Finishing = TRUE, ROW2, COL2-4
Atomic Habits = TRUE, ROW2, COL2-4
The Art of Now Glasses = FALSE ROW2, COL2-4
Finished and Final = FALSE, ROW2, COL2-4
Now and Forever = FALSE, ROW2, COL2-4
Row2, Col 1
We are still on ROW2, but now we must move to Col1, the NOT operator. This is where many beginners can get boggled.
Up to this point, we know that two nodes in our graph resolve to TRUE for Row 2, and three nodes resolve to FALSE. The next step is to execute the NOT system operator in Col #1:
The NOT operator looks to see if any one of the criteria to its right is TRUE - if so, then this row is FALSE (meaning the node will not be included in the result). Saying the same thing from a different perspective, Tana looks to see if all of the criteria are NOT TRUE (meaning FALSE). Since both are TRUE, then both nodes resolve to FALSE for Row2.
Thus, this NOT criteria will now exclude Start Finishing and Atomic Habits from the search result but include the other three.
For our data:
Start Finishing = FALSE, ROW2 resolution
Atomic Habits = FALSE, ROW2 resolution
The Art of Now Glasses = TRUE, ROW2 resolution
Finished and Final = TRUE, ROW2 resolution
Now and Forever = TRUE, ROW2 resolution
Notice the above results, because of the NOT operator, are the exact opposite of the ROW2, COL2-4 results just above.
Row1 and Row2 final resolution
Remember that "implied" AND we talk about -- the operator shown vertically in the search area?
This is where the “implied AND” comes into play.
Tana now compares Row 1 and Row 2 - if both are TRUE - remember the AND operators require all criteria to be true - then the nodes are included in the search results.
In our example, each node resolved as follow.
For our data
Start Finishing. ROW1=TRUE ROW2=FALSE / Not included in results
Atomic Habits: ROW1=TRUE ROW2=FALSE / Not included in results
The Art of Now Glasses: ROW1=TRUE ROW2=TRUE / Included in results
Finished and Final: ROW1=TRUE ROW2=TRUE / Included in results
Now and Forever = ROW1-TRUE ROW2-TRUE / Included in results
Here is the search and the results show from TANA:
Wrap up
That's enough for this issue’s Deconstruction of Live Search. Next, in this series, we will cover the differences between System nodes, fields, operators, and value types.
Below, you’ll find the most recent Tana announcements and a list of new (since the last edition) resources from YouTube, Twitter, and Slack.
Please leave any questions in SLACK, in our exclusive Substack subscribers-only Chat (including free subscribers), or DM me in SLACK or Twitter
Since the last edition, Tana has made the following announcements:
You can now “group” nodes by date fields.
You can now configure a node size (think page size) via the command line CMD/CTRL > Configure Node
Tana API was introduced. Unless you’re a developer, using the API won’t impact you. But it may bring about “plug-in” type features in the future!
Tana announced AUTOFILL. It requires your own OpenAI Key for now but will be simplified for non-builders in the future. Think automation on steroids and you get AUTOFILL. AUTOFILL VIDEO
And an irksome bug was fixed - you can now use the command line to set dates on multiple nodes at a time.
AUTOTAG is being polished. It isn’t as pretty as Autofill yet, but you can check them both out here. Tana Deconstructed will cover both AUTOTAG and AUTOFILL in a future edition.
You got a glimpse of an upcoming feature TANA PUBLISH. Check it out here in the latest Weekly Release notes.
This brings us to the end of this issue. Additional resources related to topics in this issue are listed below.
NEW TANA Resources:
Tana Tours Episode 02 is live with @R.J. Nestor!RJ let me peek inside his new Tana for Tasks template (it’s VERY cool). As well as showed me through his recurring task workflow. We could have talked for hours!If you want to get more things done in Tana, this is the episode to queue up.
Getting More Things Done With RJ Nestor: Tana Tours Episode 02
Blog Posts from Bri Ballard:
R.J. Nestor’s Tana for Task Video
This YouTube video demos a Tana workflow, built on top of my Tana for Tasks 2 (T4T2 - rjn.st/t4t2) template, that generates AI-suggested tasks to help you start new projects:
I hope it's helpful to you!
Tana Capture - 📱Capture anything, anywhere, super-fast
Fetching Tweet content and automatically describing - in Tana
I'm not an expert at Tana, nor do I work for them.
As a passionate volunteer and avid user,
I research these deconstructions to help me learn,
but I write them to help you learn from my mistakes.
I've done my utmost to ensure the accuracy of this information,
including extensive testing and review
by other Tana users more experienced than I am.
That said, I'm human.
I sometimes get it wrong
(please don't tell my husband I admitted that ☺️).
If you find an error or have questions- please comment below,
use my exclusive Substack subscribers-only Chat (including free subscribers),
or DM me in SLACK or Twitter
If you don’t have access yet to Tana, you can sign up for Early Access on the Tana.inc site, then pop over to the Slack Introduce Yourself channel, and well, eh, introduce yourself. The Tana Team will DM you an invite.
Tana development has so far catered to the tech-savvy, early adopters, but I’m here to change that. Please do not be intimidated by Slack posts. I fear many newcomers are not asking beginner questions because the technical wizards are geeking out about the newest features, and maybe some of you find that intimidating! (I know I did!)
Let me say this - I have your back 🤝.
You nailed Tana Search! Congratulations!
Awesome dive into live search!