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 +1 -1
- data/lib/xapor/model_integration.rb +12 -1
- data/xapor.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
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
|
-
|
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
|
data/xapor.gemspec
CHANGED