jruby-elasticsearch 0.0.16 → 0.0.17

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,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e6bd7db81e8b76fe90b5eb8a2a6b1cae7b37d7f4
4
- data.tar.gz: 78cca76d3270554c79f8933457707ef52042d94a
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDg4M2UzOTRhYWU1NTJhMGE1YmY2NjE3ZDc3OWU1OTYyNTQ0MTdmYQ==
5
+ data.tar.gz: !binary |-
6
+ MjFhNDIwZjdkYmY0ODg2MmQwNzdmY2NkNzdlZjY3ZGQyOThjYzI4Mg==
5
7
  SHA512:
6
- metadata.gz: d43955a359b80bdc46751c5ad4d639b7dc1b36e202734e9afc40a18aac42172ea1756408bf2c9eca565a54073241eb550eb1467ab03a5265dd64c718a01e149e
7
- data.tar.gz: f746bcb7c1b692f32e75aa731bb8960b43869989d26410d4897ed159faeb2923de8d427df21ee8f33426d630878be9e87b5039c5e371dcaf24021bd0a2ff2183
8
+ metadata.gz: !binary |-
9
+ OTRhMDBjODY1NDE5ZmI5YjEwZDg5MzE2NjdkMzcxMjQyZjI5NGNhOTYyM2Iz
10
+ MzdiODNiZDY5ZTVlNmM0MmEzNzBkYjQ3OTYzNjA2YTMyZjA3MjJhZTZjMWU3
11
+ ZWYwZDNjYjQ1NTI0ZTA5OWY3YTJjOTg1OTQ2ZDBhOTA0MWE3YTE=
12
+ data.tar.gz: !binary |-
13
+ YjEwYWRmMjIyMTA0ZGY1OGU0N2U3ZTUyZTg0ZjE3NWVmY2ZmYjJhYzU5MGI5
14
+ Y2I4OTlmZmQ2MzM3MjAyNDIzZGZlNmMzN2VlMmNjMDg3ODZkODc0NmMwM2Ex
15
+ ZDQxODgzYjE5NTkzOTgzNjNkNjVjYjZiZjBlNzA5YTc1ODVlNzQ=
@@ -2,6 +2,7 @@ require "java"
2
2
  require "jruby-elasticsearch/namespace"
3
3
  require "jruby-elasticsearch/indexrequest"
4
4
  require "jruby-elasticsearch/searchrequest"
5
+ require "jruby-elasticsearch/templaterequest"
5
6
 
6
7
  class ElasticSearch::Client
7
8
  class Error < StandardError; end
@@ -0,0 +1,116 @@
1
+ require "jruby-elasticsearch/namespace"
2
+ require "jruby-elasticsearch/request"
3
+
4
+ class ElasticSearch::DeleteIndexTemplateRequest < ElasticSearch::Request
5
+
6
+ # Create a new DeleteIndexTemplateRequest request.
7
+ public
8
+ def initialize(client, template_name)
9
+ @client = client
10
+ @template_name = template_name
11
+ begin
12
+ @prep = org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequestBuilder.new(@client.admin().indices(), @template_name)
13
+ rescue NameError
14
+ puts "Could not create DeleteIndexTemplateRequestBuilder", NameError.to_s
15
+ end
16
+ super()
17
+ end # def initialize
18
+
19
+ public
20
+ def with(&block)
21
+ instance_eval(&block)
22
+ return self
23
+ end # def with
24
+
25
+ # Execute this request.
26
+ # This call is synchronous.
27
+ #
28
+ # If a block is given, register it for both failure and success.
29
+ #
30
+ # On success, callback will receive a
31
+ # org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateResponse
32
+ public
33
+ def execute(&block)
34
+ use_callback(&block) if block_given?
35
+ action = @prep.get
36
+ return action
37
+ end # def execute
38
+
39
+ end # class ElasticSearch::DeleteIndexTemplateRequest
40
+
41
+ class ElasticSearch::GetIndexTemplatesRequest < ElasticSearch::Request
42
+
43
+ # Create a new GetIndexTemplateRequest request.
44
+ public
45
+ def initialize(client, template_name)
46
+ @client = client
47
+ @template_name = template_name
48
+ begin
49
+ @prep = org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequestBuilder.new(@client.admin().indices(), @template_name)
50
+ rescue NameError
51
+ puts "Could not create GetIndexTemplateRequestBuilder. Error => " + NameError.to_s
52
+ end
53
+ super()
54
+ end # def initialize
55
+
56
+ public
57
+ def with(&block)
58
+ instance_eval(&block)
59
+ return self
60
+ end # def with
61
+
62
+ # Execute this request.
63
+ # This call is synchronous.
64
+ #
65
+ # If a block is given, register it for both failure and success.
66
+ #
67
+ # On success, callback will receive a
68
+ # org.elasticsearch.action.admin.indices.template.get.GetIndexTemplateResponse
69
+ public
70
+ def execute(&block)
71
+ use_callback(&block) if block_given?
72
+ action = @prep.get
73
+ return action
74
+ end # def execute
75
+
76
+ end # class ElasticSearch::GetIndexTemplateRequest
77
+
78
+ class ElasticSearch::PutIndexTemplateRequest < ElasticSearch::Request
79
+
80
+ # Create a new PutIndexTemplateRequest request.
81
+ public
82
+ def initialize(client, template_name, mapping_json)
83
+ @client = client
84
+ @template_name = template_name
85
+ @mapping_json = mapping_json
86
+ begin
87
+ @prep = org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequestBuilder.new(@client.admin().indices(), @template_name)
88
+ rescue NameError
89
+ puts "Could not create PutIndexTemplateRequestBuilder", NameError.to_s
90
+ end
91
+ super()
92
+ # Assign the template
93
+ @prep.setSource(@mapping_json)
94
+ end # def initialize
95
+
96
+ public
97
+ def with(&block)
98
+ instance_eval(&block)
99
+ return self
100
+ end # def with
101
+
102
+ # Execute this request.
103
+ # This call is synchronous.
104
+ #
105
+ # If a block is given, register it for both failure and success.
106
+ #
107
+ # On success, callback will receive a
108
+ # org.elasticsearch.action.admin.indices.template.get.GetIndexTemplateResponse
109
+ public
110
+ def execute(&block)
111
+ use_callback(&block) if block_given?
112
+ action = @prep.get
113
+ return action
114
+ end # def execute
115
+
116
+ end # class ElasticSearch::PutIndexTemplateRequest
metadata CHANGED
@@ -1,24 +1,24 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Sissel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-04 00:00:00.000000000 Z
11
+ date: 2013-12-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: '...'
13
+ description: ! '...'
14
14
  email:
15
15
  - jls@semicomplete.com
16
16
  executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
- - lib/jruby-elasticsearch.rb
21
20
  - lib/jruby-elasticsearch/indexrequest.rb
21
+ - lib/jruby-elasticsearch/templaterequest.rb
22
22
  - lib/jruby-elasticsearch/client.rb
23
23
  - lib/jruby-elasticsearch/namespace.rb
24
24
  - lib/jruby-elasticsearch/request.rb
@@ -26,30 +26,31 @@ files:
26
26
  - lib/jruby-elasticsearch/bulkrequest.rb
27
27
  - lib/jruby-elasticsearch/searchrequest.rb
28
28
  - lib/jruby-elasticsearch/actionlistener.rb
29
+ - lib/jruby-elasticsearch.rb
29
30
  - test/test_integration.rb
30
31
  homepage: https://github.com/jordansissel/jruby-elasticsearch
31
32
  licenses:
32
33
  - Apache License (2.0)
33
34
  metadata: {}
34
- post_install_message:
35
+ post_install_message:
35
36
  rdoc_options: []
36
37
  require_paths:
37
38
  - lib
38
39
  - lib
39
40
  required_ruby_version: !ruby/object:Gem::Requirement
40
41
  requirements:
41
- - - '>='
42
+ - - ! '>='
42
43
  - !ruby/object:Gem::Version
43
44
  version: '0'
44
45
  required_rubygems_version: !ruby/object:Gem::Requirement
45
46
  requirements:
46
- - - '>='
47
+ - - ! '>='
47
48
  - !ruby/object:Gem::Version
48
49
  version: '0'
49
50
  requirements: []
50
- rubyforge_project:
51
- rubygems_version: 2.1.9
52
- signing_key:
51
+ rubyforge_project:
52
+ rubygems_version: 2.1.11
53
+ signing_key:
53
54
  specification_version: 4
54
55
  summary: JRuby API for ElasticSearch using the native ES Java API
55
56
  test_files: []