xapor 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +39 -0
- data/VERSION +1 -1
- data/xapor.gemspec +3 -3
- metadata +4 -4
- data/README.rdoc +0 -17
data/README.textile
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
h1. Xapor
|
2
|
+
|
3
|
+
h2. Description
|
4
|
+
Pronounced 'zap-or'. A Xapian rails plugin, designed to integrate XapianFu into ActiveRecord in a nicer,
|
5
|
+
simpler fashion.
|
6
|
+
|
7
|
+
h2. Usage
|
8
|
+
|
9
|
+
To add an index to a model, simply add a block like the following:
|
10
|
+
@class SomeModel < ActiveRecord::Base
|
11
|
+
xapor do |idx|
|
12
|
+
idx.search :name
|
13
|
+
idx.search :description
|
14
|
+
end
|
15
|
+
end@
|
16
|
+
|
17
|
+
This will create an in-memory index for the model. It will also automatically index all the items currently in the
|
18
|
+
table and add and remove items from the index as they are created, updated and removed.
|
19
|
+
|
20
|
+
Once you have added xapor to a model, you can then search it by doing:
|
21
|
+
|
22
|
+
@SomeModel.search("Some search query")@
|
23
|
+
|
24
|
+
This returns a XapianFu result set, which can be easily turned into AR models with a block like the following:
|
25
|
+
|
26
|
+
@results = []
|
27
|
+
SomeModel.search("Text").each do |result|
|
28
|
+
results << SomeModel.find(result.id)
|
29
|
+
end@
|
30
|
+
|
31
|
+
h2. TODO
|
32
|
+
|
33
|
+
* Get the indexing working with disk-based Xapian indexes
|
34
|
+
* Sort out the ability to store and retrieve extra item data in the index and remove the need to load data from the database on every search
|
35
|
+
* Add the ability to put in a 'xapor.yml' config file to define environment specific index settings (e.g. use memory in testing, and a different directory prefix in dev and prod)
|
36
|
+
|
37
|
+
h2. Copyright
|
38
|
+
|
39
|
+
Copyright (c) 2010 Hedtek Ltd. See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/xapor.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{xapor}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
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"]
|
@@ -14,13 +14,13 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.email = %q{workmad3@hedtek.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
"README.
|
17
|
+
"README.textile"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
21
|
".gitignore",
|
22
22
|
"LICENSE",
|
23
|
-
"README.
|
23
|
+
"README.textile",
|
24
24
|
"Rakefile",
|
25
25
|
"VERSION",
|
26
26
|
"features/step_definitions/xapor_steps.rb",
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- David Workman
|
@@ -65,12 +65,12 @@ extensions: []
|
|
65
65
|
|
66
66
|
extra_rdoc_files:
|
67
67
|
- LICENSE
|
68
|
-
- README.
|
68
|
+
- README.textile
|
69
69
|
files:
|
70
70
|
- .document
|
71
71
|
- .gitignore
|
72
72
|
- LICENSE
|
73
|
-
- README.
|
73
|
+
- README.textile
|
74
74
|
- Rakefile
|
75
75
|
- VERSION
|
76
76
|
- features/step_definitions/xapor_steps.rb
|
data/README.rdoc
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
= xapor
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Note on Patches/Pull Requests
|
6
|
-
|
7
|
-
* Fork the project.
|
8
|
-
* Make your feature addition or bug fix.
|
9
|
-
* Add tests for it. This is important so I don't break it in a
|
10
|
-
future version unintentionally.
|
11
|
-
* Commit, do not mess with rakefile, version, or history.
|
12
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
-
* Send me a pull request. Bonus points for topic branches.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2010 David Workman. See LICENSE for details.
|