Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: rlane@club.cc.cmu.edu (Rich Lane)
Subject: [sup-talk] [PATCH] move xapian index loading into load_index
Date: Thu,  6 Aug 2009 12:32:44 -0700	[thread overview]
Message-ID: <1249587164-14080-1-git-send-email-rlane@club.cc.cmu.edu> (raw)

---
 lib/sup/xapian_index.rb |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
index 5a5dfc1..861c2a3 100644
--- a/lib/sup/xapian_index.rb
+++ b/lib/sup/xapian_index.rb
@@ -20,14 +20,16 @@ class XapianIndex < BaseIndex
     super
 
     @index_mutex = Monitor.new
+  end
 
-    @entries = MarshalledGDBM.new File.join(dir, "entries.db")
-    @docids = MarshalledGDBM.new File.join(dir, "docids.db")
-    @thread_members = MarshalledGDBM.new File.join(dir, "thread_members.db")
-    @thread_ids = MarshalledGDBM.new File.join(dir, "thread_ids.db")
-    @assigned_docids = GDBM.new File.join(dir, "assigned_docids.db")
+  def load_index
+    @entries = MarshalledGDBM.new File.join(@dir, "entries.db")
+    @docids = MarshalledGDBM.new File.join(@dir, "docids.db")
+    @thread_members = MarshalledGDBM.new File.join(@dir, "thread_members.db")
+    @thread_ids = MarshalledGDBM.new File.join(@dir, "thread_ids.db")
+    @assigned_docids = GDBM.new File.join(@dir, "assigned_docids.db")
 
-    @xapian = Xapian::WritableDatabase.new(File.join(dir, "xapian"), Xapian::DB_CREATE_OR_OPEN)
+    @xapian = Xapian::WritableDatabase.new(File.join(@dir, "xapian"), Xapian::DB_CREATE_OR_OPEN)
     @term_generator = Xapian::TermGenerator.new()
     @term_generator.stemmer = Xapian::Stem.new(STEM_LANGUAGE)
     @enquire = Xapian::Enquire.new @xapian
@@ -35,9 +37,6 @@ class XapianIndex < BaseIndex
     @enquire.docid_order = Xapian::Enquire::ASCENDING
   end
 
-  def load_index
-  end
-
   def save_index
   end
 
-- 
1.6.4



             reply	other threads:[~2009-08-06 19:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-06 19:32 Rich Lane [this message]
2009-08-11 20:18 ` William Morgan

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=1249587164-14080-1-git-send-email-rlane@club.cc.cmu.edu \
    --to=rlane@club.cc.cmu.edu \
    /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