From: wmorgan-sup@masanjin.net (William Morgan)
Subject: [sup-talk] Notification tools
Date: Mon, 18 May 2009 11:31:35 -0700 [thread overview]
Message-ID: <1242671206-sup-2630@entry> (raw)
In-Reply-To: <1242265757-sup-2754@entry>
Reformatted excerpts from William Morgan's message of 2009-05-13:
> require 'sup'
> i = Redwood::Index.new
> i.load
> puts "total unread: " + i.ferret.search("label:unread").total_hits
> puts "inbox unread: " + i.ferret.search("label:unread AND
> label:inbox").total_hits
In the parser-user-query-fix branch (merged into next), you can now use
Index.run_query, which takes a query and returns an array of doc ids.
So you can now do this:
require 'sup'
i = Redwood::Index.new
i.load
puts "total unread: " + i.run_query("label:unread").size.to_s
puts "inbox unread: " + i.run_query("label:unread AND label:inbox").size.to_s
which has the same effect as above, but now you should be able to pass
in all the fancy options you can use on the search line (from:/to: with
contacts, :limit, date options if you have chronic installed, etc).
--
William <wmorgan-sup at masanjin.net>
next prev parent reply other threads:[~2009-05-18 18:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-13 11:37 Henri Ducrocq
2009-05-13 18:54 ` William Morgan
[not found] ` <391beaa80905131723k4b59090bi5bd541d97d1a75f2@mail.gmail.com>
[not found] ` <1242261120-sup-2999@cabinet>
2009-05-14 1:52 ` William Morgan
[not found] ` <1242273707-sup-1213@cabinet>
2009-05-14 8:37 ` Marcus Williams
[not found] ` <1242331711-sup-4976@cabinet>
2009-05-15 12:41 ` David Guibert
2009-05-17 19:23 ` Henri Ducrocq
2009-05-18 18:44 ` William Morgan
2009-05-18 20:03 ` Henri Ducrocq
2009-05-18 18:31 ` William Morgan [this message]
2009-05-14 13:04 ` Nicolas Pouillard
2009-05-15 21:22 Henri Ducrocq
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1242671206-sup-2630@entry \
--to=wmorgan-sup@masanjin.net \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox