xapor 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/README.textile +5 -4
- data/VERSION +1 -1
- data/xapor.gemspec +1 -1
- metadata +2 -2
data/LICENSE
CHANGED
data/README.textile
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
h1. Xapor
|
2
2
|
|
3
3
|
h2. Description
|
4
|
+
|
4
5
|
Pronounced 'zap-or'. A Xapian rails plugin, designed to integrate XapianFu into ActiveRecord in a nicer,
|
5
6
|
simpler fashion.
|
6
7
|
|
7
8
|
h2. Usage
|
8
9
|
|
9
10
|
To add an index to a model, simply add a block like the following:
|
10
|
-
|
11
|
+
==<pre>class SomeModel < ActiveRecord::Base
|
11
12
|
xapor do |idx|
|
12
13
|
idx.search :name
|
13
14
|
idx.search :description
|
14
15
|
end
|
15
|
-
end
|
16
|
+
end</pre>==
|
16
17
|
|
17
18
|
This will create an in-memory index for the model. It will also automatically index all the items currently in the
|
18
19
|
table and add and remove items from the index as they are created, updated and removed.
|
@@ -23,10 +24,10 @@ Once you have added xapor to a model, you can then search it by doing:
|
|
23
24
|
|
24
25
|
This returns a XapianFu result set, which can be easily turned into AR models with a block like the following:
|
25
26
|
|
26
|
-
|
27
|
+
==<pre>results = []
|
27
28
|
SomeModel.search("Text").each do |result|
|
28
29
|
results << SomeModel.find(result.id)
|
29
|
-
end
|
30
|
+
end</pre>==
|
30
31
|
|
31
32
|
h2. TODO
|
32
33
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/xapor.gemspec
CHANGED