es-elasticity 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/elasticity/search.rb +5 -4
- data/lib/elasticity/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b76200d65a0e6774e76eef4ea2251d9cc509173
|
4
|
+
data.tar.gz: 1da42184260cbe560b050fd0177f01d7245ed524
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a649dc7bb0631b411f24eb9000ba477c224deb9d2e8876d8391e2176d95cb2e88aaa15820c80d8eb5f92f0118682f96840b0bac71924c5af629613b8ce9cbf5
|
7
|
+
data.tar.gz: 67f7d70d8559fcd8167de2c9c32412a3eb5e43b588fdfe87ba01d98ff10eb01a76af57fcfd387b524892c128bec86f50f0d1246471d12138fcbc037ae0561cc7
|
data/lib/elasticity/search.rb
CHANGED
@@ -179,8 +179,9 @@ module Elasticity
|
|
179
179
|
ids = hits.map { |hit| hit["_id"] }
|
180
180
|
|
181
181
|
if ids.any?
|
182
|
-
id_col
|
183
|
-
|
182
|
+
id_col = "#{relation.connection.quote_column_name(relation.table_name)}.#{relation.connection.quote_column_name(relation.klass.primary_key)}"
|
183
|
+
id_vals = ids.map { |id| relation.connection.quote(id) }
|
184
|
+
relation.where("#{id_col} IN (?)", ids).order("FIELD(#{id_col}, #{id_vals.join(',')})")
|
184
185
|
else
|
185
186
|
relation.none
|
186
187
|
end
|
@@ -224,8 +225,8 @@ module Elasticity
|
|
224
225
|
metadata[:suggestions]
|
225
226
|
end
|
226
227
|
|
227
|
-
def method_missing(name, *args,
|
228
|
-
filtered_relation.public_send(name, *args,
|
228
|
+
def method_missing(name, *args, &block)
|
229
|
+
filtered_relation.public_send(name, *args, &block)
|
229
230
|
end
|
230
231
|
|
231
232
|
private
|
data/lib/elasticity/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: es-elasticity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Kochenburger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|