Can search specify multiple projects?


Hello all,

Can search specify multiple projects?

Example: I want to display tasks that are not done from project One and project Two:


	- Task 1 @done(2018-11-11)
	- Task 2
	- Task 1 @done(2018-11-11)
	- Task 2
	- Task 1
	- Task 2

What I want from the search:

	- Task 2
	- Task 2


Ok. I think I have this solved, but I welcome any feedback on it:

(project one//* union project two//*) except //@done


That looks good to me.

If the files were large, and any lag in the search became perceptible, it might be because the use of union entails performing two searches, and then combining them. The use of except then involves a third search and the computation of an intersection with the existing results.

Should performance become an issue (unlikely, I think) you could experiment with single search alternatives to union and except, perhaps starting with something like:

project contains one or contains two//not @done

or just

project one or two//not @done


Brilliant—thank you @complexpoint !


and the approach you are taking is generally a good one – it makes sense to start by thinking in terms of 2 or 3 very simple searches, combined by the set level operators.

Most of the time that will give more than enough performance (Jesse is the master of fast JS apps), and if you do want to fine-tune or time-compress for working with larger files later on, you can generally fuse the set operations on several searches down to corresponding Boolean operations on the clauses of a single search.

The mappings for such translations are, of course, these:

Sets of search results Single searches
intersect and
union or
except not

Combining two searches Refining one search
//project one/* intersect //@done //project one/@done
//project one/* union //project two/* //project one or two/*
//project one/* except //@done //project one/not @done


Pinging @jessegrosjean — In my opinion, the above explanations should be integrated into the Searches page of the user’s guide.