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 +4 -4
- data/README.md +5 -0
- data/embulk-input-elasticsearch.gemspec +1 -1
- data/lib/embulk/input/elasticsearch/connection.rb +2 -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: c40bf4a901edaa1d60167d30aab965d2dba2fa48
|
4
|
+
data.tar.gz: 1a565534d57b45d03363fdc1f7535405fe054eee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
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
|
-
|
77
|
+
return nil
|
77
78
|
end
|
78
79
|
end
|
79
80
|
|