X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=bin%2Fsup-tweak-labels;h=8ae5c26f9054c841ad612bdaf29c79f300cab753;hb=43ccf339799293ab02e2c69b584ca3fe7bf2fb86;hp=6f603e25fa579a74d36ff5c8c663fe9114378615;hpb=b6e4c671209d6694c5d2c88c688bfd29e901f906;p=sup diff --git a/bin/sup-tweak-labels b/bin/sup-tweak-labels index 6f603e2..8ae5c26 100755 --- a/bin/sup-tweak-labels +++ b/bin/sup-tweak-labels @@ -66,10 +66,10 @@ begin source_ids = if opts[:all_sources] - index.sources + Redwood::SourceManager.sources else ARGV.map do |uri| - index.source_for uri or Trollop::die "Unknown source: #{uri}. Did you add it with sup-add first?" + Redwood::SourceManager.source_for uri or Trollop::die "Unknown source: #{uri}. Did you add it with sup-add first?" end end.map { |s| s.id } Trollop::die "nothing to do: no sources" if source_ids.empty? @@ -83,14 +83,15 @@ begin query += ' ' + opts[:query] if opts[:query] parsed_query = index.parse_query query - docs = Enumerable::Enumerator.new(index, :each_docid, parsed_query).map - num_total = docs.size + 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 $stderr.puts "Found #{num_total} documents across #{source_ids.length} sources. Scanning..." num_changed = num_scanned = 0 last_info_time = start_time = Time.now - docs.each do |id| + ids.each do |id| num_scanned += 1 m = index.build_message id