unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [WIP 0/2] Thread based searching
Date: Tue, 20 Mar 2012 20:11:58 +0000	[thread overview]
Message-ID: <1332274320-17487-1-git-send-email-markwalters1009@gmail.com> (raw)

This is very definitely only a work in progress but there have been
several requests for this or something similar on irc.

It implements a very crude form of thread based search: the user can
ask for all the threads that have a message matching the primary query
and have a (possibly different) message matching a secondary query.

For example notmuch search --secondary-search from:A :AND: from:B
returns all threads that have a message from A and a message from B.

Similarly it allows the user to say "and not" on a thread based way.

For example notmuch search --secondary-search from:A :AND_NOT:
tag:mute returns all threads that have a message from A and no message
with tag:mute.

Anything allowing queries of this form is going to have to do some
parsing of the query (rather than leaving this to xapian). To keep
things as simple as possible this version only tries parsing of this
form if passed --secondary-search and it assumes the last command line
argument is the entire secondary search (so any complex secondary
search should be independently quoted) and that the penultimate
command line argument is either :AND: or :AND_NOT: for thread based
"and" or thread based "and not" respectively.

Finally, the two queries do play a different role even in the :AND:
case. The threads returned are exactly those that match the primary
query in (the order that would normally give) just filtered by
containing a message matching the secondary query. Thus a search for
query_a :AND query_b and a search for query_b :AND: query_a return
threads in different orders, and one may be much faster than the
other.

At the moment this is purely lib and cli (ie no emacs interface).

It is also not heavily tested and interactions with excludes or
anything unusual could easily give strange results.

Anyway I am just posting this in case anyone is interested.

Best wishes

Mark

Mark Walters (2):
  lib: multithread
  cli: search: multithread

 lib/notmuch.h    |   12 ++++++++++++
 lib/query.cc     |   46 +++++++++++++++++++++++++++++++++++++++++++++-
 notmuch-search.c |   19 +++++++++++++++++++
 3 files changed, 76 insertions(+), 1 deletions(-)

-- 
1.7.9.1

             reply	other threads:[~2012-03-20 20:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 20:11 Mark Walters [this message]
2012-03-20 20:11 ` [WIP 1/2] lib: multithread Mark Walters
2012-03-20 20:12 ` [WIP 2/2] cli: search: multithread Mark Walters
2012-04-14 19:15 ` [WIP 0/2] Thread based searching Jameson Graef Rollins

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://notmuchmail.org/

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

  git send-email \
    --in-reply-to=1332274320-17487-1-git-send-email-markwalters1009@gmail.com \
    --to=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /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://yhetil.org/notmuch.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).