aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancis <francis>2008-08-06 13:48:44 +0000
committerfrancis <francis>2008-08-06 13:48:44 +0000
commit166dc1cfaf538be85be5ec6bf0171d9845e91186 (patch)
treed01032c23b502d89b4e4dbb69031b7bf895c3c25
parent9f058e03e80e0587a4e1ec2046890a86ce586f1c (diff)
Merges from git.
-rw-r--r--vendor/plugins/acts_as_xapian/README.txt3
-rw-r--r--vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb10
2 files changed, 9 insertions, 4 deletions
diff --git a/vendor/plugins/acts_as_xapian/README.txt b/vendor/plugins/acts_as_xapian/README.txt
index c52734e40..fdd6d5424 100644
--- a/vendor/plugins/acts_as_xapian/README.txt
+++ b/vendor/plugins/acts_as_xapian/README.txt
@@ -234,3 +234,6 @@ The official home page and repository for acts_as_xapian are the
"acts_as_xapian github page":http://github.com/frabcus/acts_as_xapian/wikis
For more details about anything, see source code in lib/acts_as_xapian.rb
+
+Merging source instructions "Using git for collaboration" here:
+http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html
diff --git a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb
index 47a33f713..55661ef89 100644
--- a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb
+++ b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb
@@ -551,7 +551,8 @@ module ActsAsXapian
doc.add_term("I" + doc.data)
if self.xapian_options[:terms]
for term in self.xapian_options[:terms]
- doc.add_term(term[1] + xapian_value(term[0]))
+ ActsAsXapian.term_generator.increase_termpos # stop phrases spanning different text fields
+ ActsAsXapian.term_generator.index_text(xapian_value(term[0]), 1, term[1])
end
end
if self.xapian_options[:values]
@@ -562,7 +563,8 @@ module ActsAsXapian
if self.xapian_options[:texts]
for text in self.xapian_options[:texts]
ActsAsXapian.term_generator.increase_termpos # stop phrases spanning different text fields
- ActsAsXapian.term_generator.index_text(xapian_value(text))
+ # XXX the "1" here is a weight that could be varied for a boost function
+ ActsAsXapian.term_generator.index_text(xapian_value(text), 1)
end
end
@@ -576,7 +578,7 @@ module ActsAsXapian
# Used to mark changes needed by batch indexer
def xapian_mark_needs_index
- model = self.class.to_s
+ model = self.class.base_class.to_s
model_id = self.id
ActiveRecord::Base.transaction do
found = ActsAsXapianJob.delete_all([ "model = ? and model_id = ?", model, model_id])
@@ -588,7 +590,7 @@ module ActsAsXapian
end
end
def xapian_mark_needs_destroy
- model = self.class.to_s
+ model = self.class.base_class.to_s
model_id = self.id
ActiveRecord::Base.transaction do
found = ActsAsXapianJob.delete_all([ "model = ? and model_id = ?", model, model_id])