mongoid-elasticsearch 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongoid/elasticsearch/es.rb +6 -2
- data/lib/mongoid/elasticsearch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2767cd19b3e916b1528547ff3dc175c7a9fa9a3b
|
4
|
+
data.tar.gz: 44358cdf065b33f6b8cc879011eef4a16eaaee1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54fb55ec200d6d6858ed991f52204f2d1aad1e1d3d1c075d04f6e395d205e691d2282ac1e6eba845c33848ac5adf291b49275a1d74bc52efaf8178b7611ef229
|
7
|
+
data.tar.gz: f121d92a69446d9a7c681dae7973f4916d402c98bfcfbbcd024d94854be4370f97191464d133879cc8575ec5333c9a9d9ce7bdb92ac8e527f26f4f0659b63634
|
@@ -25,8 +25,12 @@ module Mongoid
|
|
25
25
|
steps.times do |step|
|
26
26
|
docs = q.skip(step * step_size).limit(step_size)
|
27
27
|
docs = docs.map do |obj|
|
28
|
-
|
29
|
-
|
28
|
+
if obj.es_index?
|
29
|
+
{ index: {data: obj.as_indexed_json}.merge(_id: obj.id.to_s) }
|
30
|
+
else
|
31
|
+
nil
|
32
|
+
end
|
33
|
+
end.reject { |obj| obj.nil? }
|
30
34
|
client.bulk({body: docs}.merge(type_options))
|
31
35
|
if block_given?
|
32
36
|
yield steps, step
|