elasticsearch-client 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -182,6 +182,30 @@ module ElasticSearch
182
182
  end
183
183
  end
184
184
 
185
+ # Fetch the mappings defined for this index
186
+ #
187
+ # types - the type or types to query
188
+ #
189
+ # Returns a hash, the parsed response body from elasticsearch
190
+ def get_mapping(types)
191
+ get do |req|
192
+ req.url "#{@name}/#{types}/_mapping"
193
+ end
194
+ end
195
+
196
+ # Adds mappings to the index
197
+ #
198
+ # type - the type we're modifying
199
+ # mapping - the new mapping to merge into the index
200
+ #
201
+ # Returns a hash, the parsed response body from elasticsearch
202
+ def put_mapping(type, mapping)
203
+ put do |req|
204
+ req.url "#{@name}/#{type}/_mapping"
205
+ req.body = mapping
206
+ end
207
+ end
208
+
185
209
  # Create a new index in elasticsearch
186
210
  #
187
211
  # name - the name of the index to be created
@@ -1,3 +1,3 @@
1
1
  module ElasticSearch
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-06 00:00:00.000000000 Z
12
+ date: 2012-07-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -138,7 +138,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  segments:
140
140
  - 0
141
- hash: 810915841926947438
141
+ hash: -2708320243916436462
142
142
  required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  none: false
144
144
  requirements:
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  version: '0'
148
148
  segments:
149
149
  - 0
150
- hash: 810915841926947438
150
+ hash: -2708320243916436462
151
151
  requirements: []
152
152
  rubyforge_project: elasticsearch-client
153
153
  rubygems_version: 1.8.23