Excerpts from William Morgan's message of Wed May 13 21:52:14 -0400 2009: > parsing (chronic, contact aliases, etc.) is accessible, but you can do > simple queries directly through the Ferret API with a script like:
Thanks, William, that helps; I can put a quick script around that to get
the desired behavior, at least for now.
Although, I just tried this (I seem to have had to append .to_s to each
of the total_hits), and it works, but all my results are exactly 15
greater than the relevant numbers I see if I go into the label menu with
<L><Enter>. Any idea what might cause that?
----- ~/bin/sup-biff
#!/bin/bash
ruby -I '/home/magus/src/sup/lib' <<EOF
require 'sup'
i = Redwood::Index.new
i.load
puts "total unread: " + i.ferret.search("label:unread").total_hits.to_s
puts "inbox unread: " + i.ferret.search("label:unread AND
label:inbox").total_hits.to_s
puts "inbox total: " + i.ferret.search("label:inbox").total_hits.to_s
EOF
-----
[ma...@cabinet ~]$ sup-biff
[Wed May 13 23:57:56 -0400 2009] using character set encoding "utf8"
[Wed May 13 23:57:57 -0400 2009] loading index...
[Wed May 13 23:57:57 -0400 2009] loaded index of 26444 messages
total unread: 6121
inbox unread: 442
inbox total: 878
-----
Deleted 16 messages, 5 unread
Draft 1 message, 0 unread
Inbox 853 messages, 427 unread
Killed 0 messages, 0 unread
Sent 388 messages, 0 unread
Spam 0 messages, 0 unread
Starred 24 messages, 0 unread
Unread 6106 messages, 6106 unread
[Personal tags stripped for readability.]
signature.asc
Description: PGP signature
_______________________________________________ sup-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/sup-talk
