[feature request] thread-based queries

Patrick Totzke patricktotzke at googlemail.com
Wed Jan 18 06:48:23 PST 2012


Hi everyone,

A recent discussion on alot's issue tracker[0]  made it clear that it might be useful to have a thread-based
matching for queries as an alternative to the current message based approach:

Consider a thread with two messages, one has a single tag 'flagged', the other a single tag 'unread'.
Now the thread doesn't match "tag:flagged AND tag:unread" as it doesn't contain any matching messages.
However, listing the tags of this thread accumulates to ['flagged', 'unread'].

As far as I know, there is no way one can tell notmuch to evaluate the query with threads as atomic entities
instead of messages so that the thread in the example above matches. I would like to see such a switch in 
libnotmuch and the python bindings, maybe as parameter to `notmuch_query_create` or as something similar to 
`notmuch_query_set_sort`.

I am aware that I can simulate the intended behaviour by rewriting the query myself, but I think
such a feature makes sense not only for alot users and should be implemented at a lower level.
Moreover, I wouldn't be surprised if doing this at a library level is less painful than higher up
as Xapian has to parse query formulae anyway and hence should offer some convenience methods for dealing with them.
Please correct me if I'm wrong here or have just overlooked previous discussions/solutions for this issue.

Best,
/p

[o]: https://github.com/pazz/alot/issues/270


More information about the notmuch mailing list