emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: Tom <levelhalom@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Sparse trees and searching for multiple words
Date: Tue, 21 Sep 2010 22:46:35 -0400	[thread overview]
Message-ID: <87wrqe1oms.fsf@fastmail.fm> (raw)
In-Reply-To: <loom.20100919T104229-370@post.gmane.org> (Tom's message of "Sun, 19 Sep 2010 08:48:25 +0000 (UTC)")

Tom <levelhalom@gmail.com> 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

      parent reply	other threads:[~2010-09-22  2:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-19  8:48 Sparse trees and searching for multiple words Tom
2010-09-21 17:20 ` Ilya Shlyakhter
2010-09-21 22:14   ` Scot Becker
2010-09-22  2:46 ` Matt Lundin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wrqe1oms.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=levelhalom@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).