From: Rich Lane <rlane@club.cc.cmu.edu>
To: sup-talk <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] [PATCH] xapian: replace DocumentMethods module with plain monkeypatching
Date: Tue, 20 Oct 2009 02:13:58 -0400 [thread overview]
Message-ID: <1256019034-sup-9298@zyrg.net> (raw)
In-Reply-To: <1256016877-5238-1-git-send-email-rlane@club.cc.cmu.edu>
Disregard this one. (I thought master had already gotten my
update-message-state patch)
Excerpts from Rich Lane's message of Tue Oct 20 01:34:37 -0400 2009:
> ---
> lib/sup/xapian_index.rb | 25 +++++++++++++++++++++++++
> 1 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
> index e1cfe65..c373c17 100644
> --- a/lib/sup/xapian_index.rb
> +++ b/lib/sup/xapian_index.rb
> @@ -560,7 +560,32 @@ EOS
> raise "Invalid term type #{type}"
> end
> end
> +end
>
> end
>
> +class Xapian::Document
> + def entry
> + Marshal.load data
> + end
> +
> + def entry=(x)
> + self.data = Marshal.dump x
> + end
> +
> + def index_text text, prefix, weight=1
> + term_generator = Xapian::TermGenerator.new
> + term_generator.stemmer =
> Xapian::Stem.new(Redwood::XapianIndex::STEM_LANGUAGE)
> + term_generator.document = self
> + term_generator.index_text text, weight, prefix
> + end
> +
> + alias old_add_term add_term
> + def add_term term
> + if term.length <= Redwood::XapianIndex::MAX_TERM_LENGTH
> + old_add_term term
> + else
> + warn "dropping excessively long term #{term}"
> + end
> + end
> end
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
next prev parent reply other threads:[~2009-10-20 6:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-12 22:34 [sup-talk] Xapian: Term too long Tero Tilus
2009-10-15 12:59 ` William Morgan
2009-10-20 5:34 ` [sup-talk] [PATCH] xapian: replace DocumentMethods module with plain monkeypatching Rich Lane
2009-10-20 6:13 ` Rich Lane [this message]
2009-10-20 6:14 ` Rich Lane
2009-11-02 19:28 ` 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=1256019034-sup-9298@zyrg.net \
--to=rlane@club.cc.cmu.edu \
--cc=sup-talk@rubyforge.org \
/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