yoomee-mongosphinx 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +3 -0
- data/lib/mixins/indexer.rb +8 -8
- data/mongosphinx.rb +1 -1
- metadata +6 -13
data/README.rdoc
CHANGED
@@ -5,6 +5,9 @@ supporting MongoMapper to automatically index objects in Sphinx. It tries to
|
|
5
5
|
act as transparent as possible: Just an additional method in MongoMapper
|
6
6
|
and some Sphinx configuration are needed to get going.
|
7
7
|
|
8
|
+
== Yoomee Mongosphinx
|
9
|
+
Forked from burke/mongosphinx. Fixes some bugs and adds some other functionality
|
10
|
+
e.g. delta indexing.
|
8
11
|
|
9
12
|
== Prerequisites
|
10
13
|
|
data/lib/mixins/indexer.rb
CHANGED
@@ -173,8 +173,7 @@ module MongoMapper # :nodoc:
|
|
173
173
|
if self == Document
|
174
174
|
client = Riddle::Client.new
|
175
175
|
else
|
176
|
-
client = Riddle::Client.new(fulltext_opts[:server],
|
177
|
-
fulltext_opts[:port])
|
176
|
+
client = Riddle::Client.new(fulltext_opts[:server], fulltext_opts[:port])
|
178
177
|
query = query + " @classname #{self}"
|
179
178
|
end
|
180
179
|
|
@@ -193,13 +192,14 @@ module MongoMapper # :nodoc:
|
|
193
192
|
client.sort_by = sort_by
|
194
193
|
end
|
195
194
|
|
196
|
-
index_names = "
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
index_names += "
|
195
|
+
index_names = ""
|
196
|
+
class_names = (self == Document ? options[:classes] || [] : [self.to_s])
|
197
|
+
class_names.each do |class_name|
|
198
|
+
class_name = class_name.to_s
|
199
|
+
index_names += "#{class_name.underscore}_core "
|
200
|
+
index_names += "#{class_name.underscore}_delta " if class_name.camelize.constantize.has_delta_index
|
201
201
|
end
|
202
|
-
|
202
|
+
index_names = "*" if index_names.blank?
|
203
203
|
result = client.query(query, index_names)
|
204
204
|
|
205
205
|
if result and result[:status] == 0 and !(sphinx_matches = result[:matches]).empty?
|
data/mongosphinx.rb
CHANGED
metadata
CHANGED
@@ -1,33 +1,26 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yoomee-mongosphinx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Atkins
|
14
|
-
- Burke Libbey
|
15
|
-
- Ryan Neufeld
|
16
|
-
- Joost Hietbrink
|
17
14
|
autorequire:
|
18
15
|
bindir: bin
|
19
16
|
cert_chain: []
|
20
17
|
|
21
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-17 00:00:00 +01:00
|
22
19
|
default_executable:
|
23
20
|
dependencies: []
|
24
21
|
|
25
|
-
description:
|
26
|
-
email:
|
27
|
-
- matt@yoomee.com
|
28
|
-
- burke@53cr.com
|
29
|
-
- ryan@53cr.com
|
30
|
-
- joost@joopp.com
|
22
|
+
description:
|
23
|
+
email: matt@yoomee.com
|
31
24
|
executables: []
|
32
25
|
|
33
26
|
extensions: []
|