elasticsearch-extensions 0.0.27 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79ad05a12ba00c1adf6af3343e8e9cebfab6781b
4
- data.tar.gz: e6c39ff2fa59d03fb574c3cb6d7a62c1088c715c
3
+ metadata.gz: 37f6dc1d7a1b6535a6a8eb2f2acdf4a3d574e771
4
+ data.tar.gz: 6a93b7b3068e730c86d5bc1b08f47ce09a06d9ef
5
5
  SHA512:
6
- metadata.gz: 96274d4e00fd3c32c90a9e10a20915975c751e03508ecb83367a4daffe0d338d072ad842a1e93521debcccafc9ea5062baaec10da578c41c6dd2d984024ee487
7
- data.tar.gz: a700abdbbd398fceefbac51a0c5333fca9d38a9ff0600c4b0ac7a0e8029310e6e8d2089c98f34f21dd334a57bf5dddbdd10cdd00d03a10c3dac7468a3b37452d
6
+ metadata.gz: 2181eaf96dabd3ff657d16eab095f36b53ca18736db5577857ede9eb603c87a171f03d5f4c6524903b21f8c326959b60015b1b271718054379134056dfed5085
7
+ data.tar.gz: fd7e32a3b4b0e824daee180843f60040ad4d34726dc69d963234a4ce510875ffb8369954f244227505186478408f8e168dc0bbc10362d88187e554e5d9677175
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.email = ["karel.minarik@elasticsearch.org"]
11
11
  s.description = %q{Extensions for the Elasticsearch Rubygem}
12
12
  s.summary = %q{Extensions for the Elasticsearch Rubygem}
13
- s.homepage = ""
13
+ s.homepage = "https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-extensions"
14
14
  s.license = "Apache 2"
15
15
 
16
16
  s.files = `git ls-files`.split($/)
@@ -20,8 +20,8 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.add_dependency "ansi"
22
22
  s.add_dependency "elasticsearch"
23
- s.add_dependency "oj"
24
- s.add_dependency "patron"
23
+ s.add_dependency "oj" unless defined?(JRUBY_VERSION)
24
+ s.add_dependency "patron" unless defined?(JRUBY_VERSION)
25
25
 
26
26
  if defined?(RUBY_VERSION) && RUBY_VERSION > '1.9'
27
27
  s.add_dependency "ruby-prof" unless defined?(JRUBY_VERSION) || defined?(Rubinius)
@@ -4,10 +4,10 @@ require 'pathname'
4
4
  require 'fileutils'
5
5
 
6
6
  require 'multi_json'
7
- require 'oj'
7
+ require 'oj' unless defined?(JRUBY_VERSION)
8
8
 
9
9
  require 'elasticsearch'
10
- require 'patron'
10
+ require 'patron' unless defined?(JRUBY_VERSION)
11
11
 
12
12
  module Backup
13
13
  module Database
@@ -196,6 +196,7 @@ module Elasticsearch
196
196
  COMMAND
197
197
  }
198
198
  }
199
+ COMMANDS['7.0'] = COMMANDS['6.0'].clone
199
200
  COMMANDS.freeze
200
201
 
201
202
  # Create a new instance of the Cluster class
@@ -407,7 +408,7 @@ module Elasticsearch
407
408
  '0.0.0.0'
408
409
  when /^2/
409
410
  '_local_'
410
- when /^5|^6/
411
+ when /^5|^6|^7/
411
412
  '_local_'
412
413
  else
413
414
  raise RuntimeError, "Cannot determine default network host from version [#{version}]"
@@ -452,7 +453,7 @@ module Elasticsearch
452
453
  path_to_lib = File.dirname(arguments[:command]) + '/../lib/'
453
454
  version = if arguments[:version]
454
455
  arguments[:version]
455
- elsif File.exist?(path_to_lib) && !(jar = Dir.entries(path_to_lib).select { |f| f.start_with? 'elasticsearch' }.first).nil?
456
+ elsif File.exist?(path_to_lib) && !(jar = Dir.entries(path_to_lib).select { |f| f =~ /^elasticsearch\-\d/ }.first).nil?
456
457
  __log "Determining version from [#{jar}]" if ENV['DEBUG']
457
458
  if m = jar.match(/elasticsearch\-(\d+\.\d+\.\d+).*/)
458
459
  m[1]
@@ -527,6 +528,8 @@ module Elasticsearch
527
528
  '5.0'
528
529
  when /^6\..*/
529
530
  '6.0'
531
+ when /^7\..*/
532
+ '7.0'
530
533
  else
531
534
  raise RuntimeError, "Cannot determine major version from [#{version}]"
532
535
  end
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module Extensions
3
- VERSION = "0.0.27"
3
+ VERSION = "0.0.28"
4
4
  end
5
5
  end
@@ -47,36 +47,6 @@ class Elasticsearch::Extensions::ReindexIntegrationTest < Elasticsearch::Test::I
47
47
  assert_equal 3, @client.search(index: 'test2')['hits']['total']
48
48
  end
49
49
 
50
- should "copy documents with parent/child relationship" do
51
- mapping = { mappings: { p: {}, c: { _parent: { type: 'p' } } } }
52
- @client.indices.create index: 'test_parent_1', body: mapping
53
- @client.indices.create index: 'test_parent_2', body: mapping
54
-
55
- @client.index index: 'test_parent_1', type: 'p', id: 1, body: { title: 'Parent 1' }
56
- @client.index index: 'test_parent_1', type: 'p', id: 2, body: { title: 'Parent 2' }
57
- @client.index index: 'test_parent_1', type: 'c', parent: 1, body: { title: 'Child One' }
58
- @client.index index: 'test_parent_1', type: 'c', parent: 1, body: { title: 'Child Two' }
59
-
60
- @client.indices.refresh index: 'test_parent_1'
61
-
62
- reindex = Elasticsearch::Extensions::Reindex.new \
63
- source: { index: 'test_parent_1', client: @client },
64
- target: { index: 'test_parent_2' },
65
- batch_size: 2,
66
- refresh: true
67
-
68
- result = reindex.perform
69
-
70
- assert_equal 0, result[:errors]
71
- assert_equal 4, @client.search(index: 'test_parent_2')['hits']['total']
72
-
73
- response = @client.search index: 'test_parent_2', body: {
74
- query: { has_child: { type: 'c', query: { match: { title: 'two' } } } } }
75
-
76
- assert_equal 1, response['hits']['hits'].size
77
- assert_equal 'Parent 1', response['hits']['hits'][0]['_source']['title']
78
- end
79
-
80
50
  should "transform documents with a lambda" do
81
51
  reindex = Elasticsearch::Extensions::Reindex.new \
82
52
  source: { index: 'test1', client: @client },
@@ -252,7 +252,7 @@ class Elasticsearch::Extensions::TestClusterTest < Elasticsearch::Test::UnitTest
252
252
 
253
253
  should "return version from lib/elasticsearch.X.Y.Z.jar" do
254
254
  File.expects(:exist?).with('/foo/bar/bin/../lib/').returns(true)
255
- Dir.expects(:entries).with('/foo/bar/bin/../lib/').returns(['foo.jar', 'elasticsearch-2.3.0.jar'])
255
+ Dir.expects(:entries).with('/foo/bar/bin/../lib/').returns(['foo.jar', 'elasticsearch-foo-1.0.0.jar', 'elasticsearch-2.3.0.jar', 'elasticsearch-bar-9.9.9.jar'])
256
256
 
257
257
  assert_equal '2.0', @subject.__determine_version
258
258
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-12 00:00:00.000000000 Z
11
+ date: 2018-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi
@@ -267,7 +267,7 @@ files:
267
267
  - test/test/cluster/integration/cluster_test.rb
268
268
  - test/test/cluster/unit/cluster_test.rb
269
269
  - test/test_helper.rb
270
- homepage: ''
270
+ homepage: https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-extensions
271
271
  licenses:
272
272
  - Apache 2
273
273
  metadata: {}
@@ -287,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
287
287
  version: '0'
288
288
  requirements: []
289
289
  rubyforge_project:
290
- rubygems_version: 2.5.2
290
+ rubygems_version: 2.6.11
291
291
  signing_key:
292
292
  specification_version: 4
293
293
  summary: Extensions for the Elasticsearch Rubygem