xapor 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.9
1
+ 0.0.10
@@ -19,6 +19,17 @@ module Xapor::XapianFuIntegration
19
19
  xapor_db.search(query)
20
20
  end
21
21
 
22
+ def reset_index
23
+ if @db
24
+ @db.ro.close
25
+ @db.rw.close
26
+ end
27
+ @db = XapianDb.new(@config.xapian_fu_db.merge(:overwrite => true))
28
+ if block_given?
29
+ yield @db
30
+ end
31
+ end
32
+
22
33
  def xapor_config
23
34
  @config
24
35
  end
@@ -42,7 +53,7 @@ module Xapor::XapianFuIntegration
42
53
 
43
54
  def add_to_index
44
55
  doc = {:id => self.id}
45
- config.search_fields.each do |field|
56
+ self.class.xapor_config.search_fields.each do |field|
46
57
  doc[field] = self.send(field.to_sym)
47
58
  end
48
59
  self.class.xapor_db << doc
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{xapor}
8
- s.version = "0.0.9"
8
+ s.version = "0.0.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David Workman"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 9
9
- version: 0.0.9
8
+ - 10
9
+ version: 0.0.10
10
10
  platform: ruby
11
11
  authors:
12
12
  - David Workman