Skip to content

Latest commit

 

History

History
188 lines (128 loc) · 5.52 KB

searching-proposal.org

File metadata and controls

188 lines (128 loc) · 5.52 KB

Orgzly Search (PROPOSAL)

Orgzly Search

This is a proposal for extending the current search support in Orgzly.

Search results, agenda or a specific note must all be accessible using a query. That way everything can be swipe&click away (drawer) or be linked to from outside the app (widget).

Searching

Condition

Basic format of a condition is:

PROPERTY.OPERATOR.VALUE

Any text can be specified as well (double-quoted if it contains spaces) and will be searched for anywhere in the note.

Property

Following properties are supported:

titlenote’s title
bodynote’s body
sscheduled time
ddeadline time
cclosed time
ispecific state (is state)
itstate type
tnnote’s tag
tnote’s and inherited tag
ppriority
clockedtotal clock time
clockingcurrently clocked task
clockinclock-in time
clockoutclock-out time

In addition, any specific note’s property can be used. (There could be conflicts.)

Operator

Following relational operators are supported:

eqequal to
nenot equal to
ltless than
leless than or equal to
gtgreater than
gegreater than or equal to

Operator can be omitted in which case eq is assumed. For example, these two conditions are the same:

  • t.eq.office
  • t.office

The exceptions are s and d properties, for which default operator is le.

Value

For time-based properties (s, d, etc.), you can use values such as:

3dthree days from now
1wone week from now
3mthree months from now
1yone year from now
-5dfive days ago
today todtoday’s date
tomorrow tmrw tomone day from now
yesterdayone day ago
nowtoday’s time
none novalue not set
2015-01-16specific date

For searching by state (i) any string defined as either TODO or DONE state can be used as a value.

When searching by state type (it), there are three possible values:

donenotes with one of the DONE states
todonotes with one of the TODO states
nonenotes with no state set

When searching by tags (t or tn) a word containing any character except for space and : can be used.

Value for priority searching (p) is a character from a to z.

Multiple conditions

Multiple conditions can be specified at the same time. Conditions are separated with space or a logical operator.

Following logical operators are supported:

  • not
  • and
  • or

not has higher precedence than and which has higher precedence then or.

Parentheses (( )) can be used to explicitly denote precedence by grouping parts of a condition that should be evaluated first.

Property can also be prepended with - (with no space in between) which is equivalent to using not before the condition. For example, these two conditions are the same:

  • -i.done
  • not i.done

If conditions are separated by space, logical and is assumed.

Helper conditions

dues.le.today or d.le.today

More useful helpers?

Examples

it.todo -i.wait
Notes with a todo type of state, except WAIT
i.todo or i.next or i.wait
Notes with either TODO, NEXT or WAIT state set
i.next t.errand
NEXT notes tagged with errand
b.Home t.buy
Notes from Home notebook tagged with buy
i.wait
Notes with WAIT state
-it.done votes.gt.5
Tasks not done with votes property larger then 5

More useful examples?

Sorting

Notes are sorted by notebook name then priority. If s or d are used in the query, they are also sorted by scheduled or deadline time. They are always sorted by position in the notebook last.

You can change this behavior by using o operator.

o.PROPERTYsort by property
-o.PROPERTYsort by property (reverse order)

Following properties are supported:

b book notebooknotebook name
s sched scheduledscheduled time
d dead deadlinedeadline time
p pri prio prioritypriority

Examples

o.book o.pri
Sort by notebook name then priority
o.book o.pri o.s
Sort by notebook name then priority then scheduled time

Agenda & Grouping

You can display an agenda for a specific period using:

a.PERIOD

Period can be for example:

-7dfrom 7 days ago until today
-7d.-2dfrom 7 days ago until 2 days ago
2015-01-01.2015-01-31for a specific time period

Notes will be grouped by day.

You can change the grouping using:

g.GROUP

Supported groups are:

dayday
weekweek
yearyear
tagtag

Does this even make sense?

Is “a” just a helper and grouping a separate feature?