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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4f292ee8adb28db5b0013bf8357627c9df82865
4
- data.tar.gz: 6cad535741df733ba787d29f1f4c0f2233dce2ee
3
+ metadata.gz: 2767cd19b3e916b1528547ff3dc175c7a9fa9a3b
4
+ data.tar.gz: 44358cdf065b33f6b8cc879011eef4a16eaaee1b
5
5
  SHA512:
6
- metadata.gz: 4e410de984a20d827035416a6a6e44ea628f9b63c6710d2ff5447059dea1230505edbd58b1029a399699fc93fc490c1c54b164f0b441a8c4783de8b10ee469f3
7
- data.tar.gz: 4a9509adc2252f866d0069ca080d462dea4bd81fd9628d50e4bf5affb7f5b22273a04029e1d50c8c9f328078547255a12bf1e144653a2438dcf7af40ad497050
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
- { index: {data: obj.as_indexed_json}.merge(_id: obj.id.to_s) }
29
- end
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
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Elasticsearch
3
- VERSION = "0.4.1"
3
+ VERSION = "0.4.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebtv