unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* query on a subset of messages ?
@ 2012-07-09  8:25 Sebastien Binet
  2012-07-09 15:55 ` Jameson Graef Rollins
  2012-07-09 16:30 ` query on a subset of messages ? Austin Clements
  0 siblings, 2 replies; 12+ messages in thread
From: Sebastien Binet @ 2012-07-09  8:25 UTC (permalink / raw)
  To: Notmuch developer list

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]


hi there,

I was trying to reduce the I/O stress during my usual email
fetching+tagging by writing a little program using the go bindings to
notmuch.

ie:
db, status := notmuch.OpenDatabase(db_path,
    		notmuch.DATABASE_MODE_READ_WRITE)
query := db.CreateQuery("(tag:new AND tag:inbox)")
msgs := query.SearchMessages()
for _,msg := range msgs {
  tag_msg(msg, tagqueries)
}


where tagqueries is a subquery of the form:
[
    {
        "Cmd": "+to-me",
        "Query": "(to:sebastien.binet@cern.ch and not tag:to-me)"
    },
    {
        "Cmd": "+sci-notmuch",
        "Query": "from:notmuch@notmuchmail.org or to:notmuch@notmuchmail.org or subject:notmuch"
    }
]


the idea being that I only need to crawl through the db only once and
then iteratively apply tags on those messages (instead of repeatedly
running "notmuch tag ..." for each and every of those many
'tag-queries')

I couldn't find any C-API to do such a thing using the notmuch library.
did I overlook something ?

Is it something useful to add ?

-s

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-07-19  8:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-09  8:25 query on a subset of messages ? Sebastien Binet
2012-07-09 15:55 ` Jameson Graef Rollins
2012-07-09 16:45   ` Sebastien Binet
2012-07-09 17:04     ` post-new [was: Re: query on a subset of messages ?] Sebastien Binet
2012-07-09 17:11       ` Jameson Graef Rollins
2012-07-09 17:37         ` Jani Nikula
2012-07-10  9:59           ` Sebastien Binet
2012-07-10 16:48             ` Jameson Graef Rollins
2012-07-10 13:16       ` Jani Nikula
2012-07-09 16:30 ` query on a subset of messages ? Austin Clements
2012-07-09 17:06   ` Sebastien Binet
2012-07-19  8:13     ` Sebastien Binet

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).