Freakin' Gigantic Advanced Search Expression
(closed account) says:
I just came up with a hell of a complex advanced search, and I thought the structure might be useful for others.
The expression is:
(((due:never OR dueBefore:today) NOT (list:BooksFun OR list:BooksNonF)) OR (isRepeating:true AND dueWithin:"2 days of today") OR (isRepeating:false AND dueWithin:"17 days of today") OR ((list:BooksFun OR list:BooksNonF) AND dueWithin:"7 days of today") OR (tag:weeklyreads AND dueWithin:"7 days of today")) NOT (tag:@work OR tag:@hold OR tag:@header OR list:zSomeday)
Breaking it down:
FIRST clause, surrounded by parantheses:
============> (due:never OR dueBefore:today NOT (list:BooksFUN or list:BooksNonF)) OR
Anything that has no due date or is overdue -- exempting my library reading list -- should be on this list.
============> (isRepeating:true AND dueWithin:"2 days of today") OR
If I've got a recurrent task, I want a shorter display period -- i.e., I don't want to be bothered with next week's "sweep the floor" reminder.
============> (isRepeating:false AND dueWithin:"17 days of today") OR
A non-recurrent task that I've given a due date, I want to see two and a half weeks out.
============> ((list:BooksFun OR list:BooksNonF) AND dueWithin:"7 days of today") OR
Show me library books due within a week.
============> (tag;weeklyreads AND dueWithin:"7 days of today")
Show me only the next installment of a number of lengthy books I've split up into weekly assignments.
SECOND clause, a "NOT" filter I apply to the tasks generated by the above:
============> tag:@work [OR] (tag:@home AND tag:@mac) OR
Depending on whether this is my 'home' list or my 'work' list. Instead of displaying only a @home tag at home and and only a @work tag at work, I instead filter OUT work-only tasks at home and filter OUT home-only tasks at work, leaving tasks which are location-neutral to appear on both lists.
============> tag:@hold OR
A hold tag -- my version of "disabling" a task while leaving it in the system, if I'm not ready to attack it any time in the near future.
============> tag:@header OR
A tip I picked up from someone else -- each of my manual project lists has a goal statement moved to the top via "Priority 1". These goal statements each have a @header tag on them so that for smart aggregating lists like these, they can be filtered out.
============> list:zSomeday
My "fantastical tasks to contemplate hashing out one day when everything else in the world is done" list.
The expression is:
(((due:never OR dueBefore:today) NOT (list:BooksFun OR list:BooksNonF)) OR (isRepeating:true AND dueWithin:"2 days of today") OR (isRepeating:false AND dueWithin:"17 days of today") OR ((list:BooksFun OR list:BooksNonF) AND dueWithin:"7 days of today") OR (tag:weeklyreads AND dueWithin:"7 days of today")) NOT (tag:@work OR tag:@hold OR tag:@header OR list:zSomeday)
Breaking it down:
FIRST clause, surrounded by parantheses:
============> (due:never OR dueBefore:today NOT (list:BooksFUN or list:BooksNonF)) OR
Anything that has no due date or is overdue -- exempting my library reading list -- should be on this list.
============> (isRepeating:true AND dueWithin:"2 days of today") OR
If I've got a recurrent task, I want a shorter display period -- i.e., I don't want to be bothered with next week's "sweep the floor" reminder.
============> (isRepeating:false AND dueWithin:"17 days of today") OR
A non-recurrent task that I've given a due date, I want to see two and a half weeks out.
============> ((list:BooksFun OR list:BooksNonF) AND dueWithin:"7 days of today") OR
Show me library books due within a week.
============> (tag;weeklyreads AND dueWithin:"7 days of today")
Show me only the next installment of a number of lengthy books I've split up into weekly assignments.
SECOND clause, a "NOT" filter I apply to the tasks generated by the above:
============> tag:@work [OR] (tag:@home AND tag:@mac) OR
Depending on whether this is my 'home' list or my 'work' list. Instead of displaying only a @home tag at home and and only a @work tag at work, I instead filter OUT work-only tasks at home and filter OUT home-only tasks at work, leaving tasks which are location-neutral to appear on both lists.
============> tag:@hold OR
A hold tag -- my version of "disabling" a task while leaving it in the system, if I'm not ready to attack it any time in the near future.
============> tag:@header OR
A tip I picked up from someone else -- each of my manual project lists has a goal statement moved to the top via "Priority 1". These goal statements each have a @header tag on them so that for smart aggregating lists like these, they can be filtered out.
============> list:zSomeday
My "fantastical tasks to contemplate hashing out one day when everything else in the world is done" list.
(closed account) says:
Actually, after giving this a test run, one part of the formula needed to be tweaked -- the isRepeating:false category catches my weeklyreads and library books to the full 17 days, so they have to be manually excluded:
============> ((isRepeating:false AND dueWithin:"17 days of today") NOT (list:BooksFun OR list:BooksNonF OR tag:weeklyreads)) OR
============> ((isRepeating:false AND dueWithin:"17 days of today") NOT (list:BooksFun OR list:BooksNonF OR tag:weeklyreads)) OR
(closed account) says:
And, by the way, massive props to Emily and Crew for enabling me to be so incredibly overanal about exactly what I want to see displayed and to give me a search language that lets me construct a monstrosity like that. It's amazing.
emily (Remember The Milk) says:
Hehe, this is awesome. Great to see the search operators being put to good use :)
(closed account) says:
I'm glad you resurrected this, Emily.
Since I'm not a query ninja, I greatly appreciate any cool Smart List queries that I can use.
GREAT work, wcitypoe
Since I'm not a query ninja, I greatly appreciate any cool Smart List queries that I can use.
GREAT work, wcitypoe
yawar.amin says:
Why not just tag all those tasks `someday' and search for that tag?
(closed account) says:
"Why not just tag all those tasks `someday' and search for that tag?"
I'm afraid I don't understand your question. I'm interpreting it like: "Why use the letter 'P' when you can use the letter 'L'?" What this expression is and tagging something with "someday" are entirely separate expressions.
I should note, though, that the above has become greatly simplified with the ability to reference a list with another smart list. Now, the "home" and "work" lists just refer to one list and apply NOT statements to it, i.e. "list:Combined NOT (tag:home OR tag:mac)", instead of reproducing the entire expression once again.
I'm afraid I don't understand your question. I'm interpreting it like: "Why use the letter 'P' when you can use the letter 'L'?" What this expression is and tagging something with "someday" are entirely separate expressions.
I should note, though, that the above has become greatly simplified with the ability to reference a list with another smart list. Now, the "home" and "work" lists just refer to one list and apply NOT statements to it, i.e. "list:Combined NOT (tag:home OR tag:mac)", instead of reproducing the entire expression once again.
klamano says:
@yawar.amin :
Because you had to set the tag yourself and this query does it automagically
Because you had to set the tag yourself and this query does it automagically
bzpilman says:
Instead of a @header tag, I use a prefix in the Name, so all my projects have '-=' in the beginning of their header entries. It's pretty much the same thing, except you can cut a tag out of your tag cloud.
Also, it's easier to create project structures (sub projects) using -=, --=, ---=, and on.
Finally, they are more easily identified on a given list and will sometimes work towards a nicer formatting.
(The reason I don't simply use '-' is I need a unique combination of symbols for an accurate 'Name:-=' search query.)
Also, it's easier to create project structures (sub projects) using -=, --=, ---=, and on.
Finally, they are more easily identified on a given list and will sometimes work towards a nicer formatting.
(The reason I don't simply use '-' is I need a unique combination of symbols for an accurate 'Name:-=' search query.)
Log in
to post a reply.