embulk-input-elasticsearch 0.3.4 → 0.3.5

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: 6fe4375a3aa307d250dea7ecb85b3205d5bea8f0
4
- data.tar.gz: 40122cde69c0ee271ca6f10b1dc06aea45870e27
3
+ metadata.gz: c40bf4a901edaa1d60167d30aab965d2dba2fa48
4
+ data.tar.gz: 1a565534d57b45d03363fdc1f7535405fe054eee
5
5
  SHA512:
6
- metadata.gz: 64c5d668c9edf83b90b72911a12ccb8169cc6eba9d6c8cddc2dc06e3963c970edadcb24ffc04b8ad9b81c9a9f1549e3cc0ceefb88fcfe73862e4067ff6782319
7
- data.tar.gz: fbf04ec4f70e7608222150567f88c263118b4db7dc06a469f665dab423844aeb6990348eb480e55850b260d57097af9a60049ddae0e601c2b443e0dffa889f57
6
+ metadata.gz: beedbb1fb8ad15cba9fa52d84b1c92d0f00b050b308e5efe03a60d190f34a9b79588ac1eeeb8cb2dcbae3e76ff9f34d85ed970015936ad76517a8fd516eb447d
7
+ data.tar.gz: 45d30e6c0be97b35de24ed9ae309fb2d20deca4daef112b8d9bc75b7a845ceb2ea20f97fb518064749024359ede7f07c8d10676c6695c18ed4e78550bfda3870
data/README.md CHANGED
@@ -19,6 +19,8 @@
19
19
  - **limit_size**: limit size unit query. (integer, default: unlimit)
20
20
  - **num_threads**: number of threads for queries. (integer, default: 1)
21
21
  - **retry_on_failure**: retry on failure. set 0 is retry forever. (integer, default: 5)
22
+ - **sort**: sort order. (hash, default: nil)
23
+ - **scroll**: scroll. to keep the search context. (string, default: '1m')
22
24
  - **fields**: fields (array, required)
23
25
  - **name**: name (string, required)
24
26
  - **type**: type (string, required)
@@ -41,6 +43,9 @@ in:
41
43
  per_size: 1000
42
44
  limit_size: 200000
43
45
  num_threads: 2
46
+ sort:
47
+ m_corporation_id: desc
48
+ employee_range: asc
44
49
  fields:
45
50
  - { name: _id, type: string, metadata: true }
46
51
  - { name: _type, type: string, metadata: true }
@@ -1,7 +1,7 @@
1
1
 
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "embulk-input-elasticsearch"
4
- spec.version = "0.3.4"
4
+ spec.version = "0.3.5"
5
5
  spec.authors = ["toyama0919"]
6
6
  spec.summary = "Elasticsearch input plugin for Embulk"
7
7
  spec.description = "Loads records from Elasticsearch. parallel query support."
@@ -45,6 +45,7 @@ module Embulk
45
45
  search_option = get_search_option(query)
46
46
  Embulk.logger.info("#{search_option}")
47
47
  r = search_with_retry { @client.search(search_option) }
48
+ return if r.nil?
48
49
  i = 0
49
50
  Converter.get_sources(r, @fields).each do |result|
50
51
  yield(result) if block_given?
@@ -73,7 +74,7 @@ module Embulk
73
74
  retry
74
75
  end
75
76
  Embulk.logger.error "Could not search to Elasticsearch after #{retries} retries. #{e.message}"
76
- raise
77
+ return nil
77
78
  end
78
79
  end
79
80
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - toyama0919