Search
The Agenda view support search using free-text as well as by tags and scheduling dates by using search expressions.
You can combine free-text and search expressions at the same time to create an advance search query.
All todos that fullfil the search expressions will be shown.
Free-text search
When searching for words you can type them as you would expect and the search result will show all entries which contain the words in the header and/or body text.
The search is case insensitive.
If you type a string such as "word1 word2"
then it will match all entries which have the full exact string.
If you type a string such as word1 AND word2
or simply word1 word2
then it will match all entries which have both words somewhere in it.
If you type a string such as word1 OR word2
then it will match all entries which have both either one of the words somewhere in it.
It's currently not possible to combine an AND
and an OR
search.
Tag search
You can search for todos which have one or more tags assigned by using the t.
expression.
t.tag1
- Finds todos which have tag1 assigned to it.
t.tag1 t.tag2
- Finds todos which have tag1 AND tag2 assigned.
t.tag1 OR t.tag2
- Finds todos which have tag1 OR tag2 assigned.
The tag search will match on subsets, so if searching on t.tag
will match todos which have either tag1 or tag2 assigned.
As tags are inherited from the parents the t
expression would match items which are on a level below any parent header tagged with the search expression.
If you only want to find items which have a direct tag you can use the tn
expression.
Tag search (explicitly tagged, not inherited)
If you only want to find items which themselves has the tag and not because they are children of an item which has the tag, then you can use the tn
expression.
tn.tag1
It works exactly the same as the t expression.
State search
You can search for a specific Todo state by using the i
expression.
i.done
- Finds todos with the state of DONE.
i.done i.canceled
- Finds todos with the state of DONE OR CANCELED.
State-type search
You can search for a specific state-type by using the it
expression.
A state-type is basically the two basic states an Org todo item can be in. Either it is todo
(eg. TODO, WAIT, NEXT, DOING) or it is done
(eg. DONE, CANCELED, ARCHIVED).
Using the below search expression you can search all different states within that state-type.
it.todo
- Finds todos with the states of TODO and WAIT if that is how you have defined it in the EasyOrg settings or in the org-file.
Priority search
You can search for a specific Todo priority by using the p
expression.
p.a
- Finds todos with a priority of A.
p.a p.b
- Finds todos with a prio of A OR B.
Header Level search
You can search for a specific header level by using the l
expression.
l.3
- Finds todos and headers on level 3 (Three asterisks (***)).
l.2 l.3
- Finds todos and header on level 2 OR level 3.
Parent Header search
You can search for all tasks below a certain parent header by using the h
expression.
h.my+header+text
- Find all tasks which have a parent header containing the text 'my header text'.
Custom Properties
If you are using custom properties on some of your items, then you can search for their values by using the property value search expression v
.
You can use it on the form:
v.PROPERTY_KEY.value
.
If the value you are searching for is a number then you can add an additional greater than or equal or less than or equal operator. Default ie equal.
v.PROPERTY_KEY.ge.value
v.HOURS.ge.8
- Items with property HOURS >= 8.
v.CUSTOMER.acme+inc
- Items with property CUSTOMER = acme inc.
Search on Files and Categories (in Multi-File agenda view)
The f
and fc
expressions are used for searching on tasks belonging to files and categories respectively.
These expressions are useful in the Multi File agenda view where tasks from many files are shown at once. By searching for a specific file it's possible to temporarily see tasks from only that file. By using the the inverse .
operator in frotn you can exclude tasks from a certain file.
If a file has a category defined (by using the file based #+CATEGORY: Journaling
), then fc
can be used to find tasks belonging to that category.
f.my-file-name
- Items inside the file my-file-name.org.
.f.my-file-name.org
- Items NOT inside the file my-file-name.org.
fc.journaling
- Items inside a file(s) with category Journaling.
By default, if no category is defined for a file, then the category is by default the same as the file name. In those cases f
and fc
yield the same result.
Search on Links
You can search for links by using the li
expression.
li.#220730-184556
- Find links pointing to CUSTOM_ID 220730-184556
li.My+Header+Text
- Find links pointing to an item with a header which cotains the string 'My Header Text'.
Search based on scheduling dates
You can search for deadline, scheduled, closed dates, created at dates and active timestamps (events).
s.
- scheduled
d.
- deadline
c.
- closed
cr.
- created at
e.
- active timestamps (events)
You can search either by using a date such as 2021-12-20
or by using time periods such as 5 days 5d
, 1 week 1w
or 2 months ago -2m
.
A negative period means in the past, while a positive period means in the future.
You can also combine the date/period with the 'less than or equal' le
operator or the 'greater than or equal' ge
operator. If le/ge
is omitted, the le
will be used by default when searching using periods and eq
when using a date.
There are also a few alias: today
, tomorrow
and yesterday
. When using these aliases and if le/ge
is omitted, the eq
will be used by default.
You can create time periods by combining two expressions for the same scheduling type such as s.ge.0d AND s.le.7d
to get all Todos scheduled for the coming eight days, including today or s.today OR s.yesterday
to show tasks which are scheduled for today or yesterday.
So combining this together we can compose the following examples:
s.2022-03-22
- Find todos which are scheduled on exactly 2022-03-22.
s.today
- Find todos which are scheduled for today.
c.le.2022-03-22
- Find todos which were closed on or before 2022-03-22.
d.ge.2022-03-22
- Find todos which have a deadline on or after 2022-03-22.
s.2d
- Find todos which are scheduled in two days or before.
s.le.2d
- Same as above as le
is default.
s.ge.2d
- Find todos which are scheduled in two days or later.
s.le.-2d
- Find todos which are scheduled two days ago or earlier.
s.ge.-2d
- Find todos which are scheduled two days ago or later.
d.ge.-1w d.le.0d
- Todos with deadline in the last 8 days including today.
d.ge.0d d.le.1w
- Todos with deadline in the coming 8 days including today.
s.ge.2d t.docs search OR find
- Todos scheduled two days or more from now with tag 'docs' and containing the word 'search' or 'find'.
Where:
d
- day
w
- week
m
- month
y
- year
Negated/NOT Searches
If you want to find the opposite set or results, i.ie you want the Not type of result, then you can use the .
(dot) operator in front of your search expression. For example: .i.done
finds items which are in any state except the DONE state.
The .
operator can be used with the following search expressions:
.i
.it
.t
.tn
.p
TIP. If you are searching in the Calendar view and you do not get any hit, try switching to the Agenda or List view instead as the Calendar view only shows a subset of your entries.
Saving your searches
You can save your most commonly used searches so you do not have to type them over and over. This way you can also create your own custom agenda views.
To save a search you simply type in the search expression you want to save and then press the 'Save' button to the left of the search field.
You can also give the saved search a descriptive name so that it is easier to see what it does. You do that by writing the name efter a #
character.
For example like so:
s.ge.0d s.le.1w #Upcoming week
You can have a maximum of 15 saved searches at any one time. The least used search will be removed first.
Deleting a saved search
You can also delete your saved searches. To do so simply select a save search (basically perform a search with a saved search) and then press the Delete button. It should now have disappeared from your list.
TIP. If you are using your saved searches as a custom agenda view, then you might in some cases want to use the List view as base as it does not place the items under any specific predefined heading.