Subject: [sup-talk] [PATCH] xapian: dont exclude spam/etc in some internal searches

From: [email-masked] (Rich Lane)
Date: Sat, 25 Jul 2009 12:27:08 -0700

---
 bin/sup-dump         |    2 +-
 bin/sup-sync         |    2 +-
 bin/sup-sync-back    |    2 +-
 bin/sup-tweak-labels |    1 +
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/bin/sup-dump b/bin/sup-dump
index c18a767..ba36b21 100755
--- a/bin/sup-dump
+++ b/bin/sup-dump
@@ -25,6 +25,6 @@ index = Redwood::Index.new
 Redwood::SourceManager.new
 index.load
 
-index.each_message do |m|
+index.each_message :load_spam => true, :load_deleted => true, :load_killed => true do |m|
   puts "#{m.id} (#{m.labels * ' '})"
 end
diff --git a/bin/sup-sync b/bin/sup-sync
index 270524a..8e37c74 100755
--- a/bin/sup-sync
+++ b/bin/sup-sync
@@ -213,7 +213,7 @@ begin
     num_del, num_scanned = 0, 0
     sources.each do |source|
       raise "no source id for #{source}" unless source.id
-      index.each_message :source_id => source.id do |m|
+      index.each_message :source_id => source.id, :load_spam => true, :load_deleted => true, :load_killed => true do |m|
         num_scanned += 1
         unless seen[m.id]
           next unless m.source_info >= opts[:start_at] if opts[:start_at]
diff --git a/bin/sup-sync-back b/bin/sup-sync-back
index da94bbd..56ac4eb 100755
--- a/bin/sup-sync-back
+++ b/bin/sup-sync-back
@@ -16,7 +16,7 @@ def die msg
   exit(-1)
 end
 def has_any_from_source_with_label? index, source, label
-  query = { :source_id => source.id, :label => label, :limit => 1 }
+  query = { :source_id => source.id, :label => label, :limit => 1, :load_spam => true, :load_deleted => true, :load_killed => true }
   not Enumerable::Enumerator.new(index, :each_id, query).map.empty?
 end
 
diff --git a/bin/sup-tweak-labels b/bin/sup-tweak-labels
index a8115ea..8ae5c26 100755
--- a/bin/sup-tweak-labels
+++ b/bin/sup-tweak-labels
@@ -83,6 +83,7 @@ begin
   query += ' ' + opts[:query] if opts[:query]
 
   parsed_query = index.parse_query query
+  parsed_query.merge! :load_spam => true, :load_deleted => true, :load_killed => true
   ids = Enumerable::Enumerator.new(index, :each_id, parsed_query).map
   num_total = ids.size
 
-- 
1.6.0.4

---

From: [email-masked] (William Morgan)
Date: Mon, 27 Jul 2009 09:16:43 -0700

Applied, thanks.
-- 
William <wmorgan-sup at masanjin.net>