From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Sparse trees and searching for multiple words Date: Tue, 21 Sep 2010 22:46:35 -0400 Message-ID: <87wrqe1oms.fsf@fastmail.fm> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=38629 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyFM2-0004ht-SH for emacs-orgmode@gnu.org; Tue, 21 Sep 2010 22:46:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OyFM1-000635-Pa for emacs-orgmode@gnu.org; Tue, 21 Sep 2010 22:46:42 -0400 Received: from out2.smtp.messagingengine.com ([66.111.4.26]:52214) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyFM1-00061y-NB for emacs-orgmode@gnu.org; Tue, 21 Sep 2010 22:46:41 -0400 In-Reply-To: (Tom's message of "Sun, 19 Sep 2010 08:48:25 +0000 (UTC)") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Tom Cc: emacs-orgmode@gnu.org Tom writes: > I see sparse trees can be constructed by searching for a regexp, but I > can't find the same ability for multiple searches. > > For example, I'd like to see entries which contains the words 'cat' and > 'dog' in any order. Or 'apple', 'orange', 'melon', 'plum' and 'pear' > in any order. > > Searching for multiple keywords in a single operation is a pretty > basic feature. I recommend adding it if currently there is no way to > do it in org. For such searches, I use org-search-view: C-c a s +cat +dog [RET] This will pull up the headlines for all entries that contain the substrings cat and dog in any order. By default, org-search-view treats the entry as a single substring if there are no plus or minus signs. E.g., C-c a s cat dog [RET] ...will find only those entries that have the precise string "cat dog". For searches more like Google's (i.e., lazy booleans), you can set the variable org-agenda-search-view-always-boolean to t. Then, a search such as: C-c a s cat dog [RET] ...will find all entries that have the words cat and dog in any order. ,----[ C-h v org-agenda-search-view-always-boolean ] | When this is non-nil, the string will be split on whitespace, and each | snippet will be searched individually, and all must match in order to | select an entry. `---- If you want to force "cat" and "dog" to match full words only, you can set the variable org-agenda-search-view-force-full-words to t. Best, Matt