elastic_adapter 0.0.8 → 0.1.0

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.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +8 -0
  3. data/lib/elastic_adapter/index.rb +16 -15
  4. data/lib/elastic_adapter/response.rb +25 -0
  5. data/lib/elastic_adapter/responses/with_aggregations.rb +9 -0
  6. data/lib/elastic_adapter/responses/with_count.rb +9 -0
  7. data/lib/elastic_adapter/responses/with_exception.rb +9 -0
  8. data/lib/elastic_adapter/responses/with_hit.rb +24 -0
  9. data/lib/elastic_adapter/responses/with_hits.rb +18 -0
  10. data/lib/elastic_adapter/responses/with_suggestions.rb +9 -0
  11. data/lib/elastic_adapter/responses/with_validations.rb +13 -0
  12. data/lib/elastic_adapter/version.rb +1 -1
  13. data/lib/elastic_adapter.rb +8 -9
  14. data/spec/cassettes/ElasticAdapter_Index/_aggregate/response/{is_a_AggregationResponse.yml → has_a_aggregation.yml} +3 -3
  15. data/spec/cassettes/ElasticAdapter_Index/_aggregate/response/is_a_WithAggregation.yml +30 -0
  16. data/spec/cassettes/ElasticAdapter_Index/_aggregate.yml +8 -8
  17. data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/is_a_fixnum.yml +5 -5
  18. data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/returns_the_amount_of_all_documents.yml +1 -1
  19. data/spec/cassettes/ElasticAdapter_Index/_count/empty_index.yml +2 -2
  20. data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index/is_a_fixnum.yml +5 -5
  21. data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index/returns_1.yml +1 -1
  22. data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index.yml +4 -4
  23. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present/response/has_an_exception.yml +1 -1
  24. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present/response/is_a_Response.yml +1 -1
  25. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present.yml +2 -2
  26. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response/has_no_exception.yml +1 -1
  27. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response/is_a_Response.yml +1 -1
  28. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response.yml +1 -1
  29. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_not_present/repsonse/has_an_exception.yml +1 -1
  30. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_not_present/repsonse/is_a_Response.yml +1 -1
  31. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/has_no_exception.yml +1 -1
  32. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/has_no_exceptionElasticAdapter_Index/_delete_index/index_present/repsonse.yml +1 -1
  33. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/is_a_Response.yml +1 -1
  34. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/is_a_ResponseElasticAdapter_Index/_delete_index/index_present/repsonse.yml +1 -1
  35. data/spec/cassettes/ElasticAdapter_Index/_get/document_exists/response/document/returns_the_document.yml +1 -1
  36. data/spec/cassettes/ElasticAdapter_Index/_get/document_exists.yml +3 -3
  37. data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/doesn_t_change_the_document_count.yml +1 -55
  38. data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/invokes_to_hash_on_the_document.yml +2 -2
  39. data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/updates_the_document.yml +2 -2
  40. data/spec/cassettes/ElasticAdapter_Index/_index/existing_document.yml +3 -3
  41. data/spec/cassettes/ElasticAdapter_Index/_index/new_document/indexes_a_document.yml +3 -3
  42. data/spec/cassettes/ElasticAdapter_Index/_index/new_document/invokes_to_hash_on_the_document.yml +2 -2
  43. data/spec/cassettes/ElasticAdapter_Index/_index/new_document.yml +2 -2
  44. data/spec/cassettes/ElasticAdapter_Index/_search/match_all/returns_all_documents.yml +2 -2
  45. data/spec/cassettes/ElasticAdapter_Index/_search/zoo/returns_one_document.yml +3 -3
  46. data/spec/cassettes/ElasticAdapter_Index/_search/zoo/returns_the_wanted_document.yml +2 -2
  47. data/spec/cassettes/ElasticAdapter_Index/_search.yml +16 -16
  48. data/spec/cassettes/ElasticAdapter_Index/_suggest/query_ba_/returns_bar.yml +1 -1
  49. data/spec/cassettes/ElasticAdapter_Index/_suggest/query_ba_/returns_one_result.yml +1 -1
  50. data/spec/cassettes/ElasticAdapter_Index/_suggest.yml +4 -4
  51. data/spec/cassettes/ElasticAdapter_Index/_validate/invalid_query/is_a_response.yml +1 -1
  52. data/spec/cassettes/ElasticAdapter_Index/_validate/invalid_query/valid_/is_false.yml +1 -1
  53. data/spec/cassettes/ElasticAdapter_Index/_validate/valid_query/is_a_response.yml +1 -1
  54. data/spec/cassettes/ElasticAdapter_Index/_validate/valid_query/is_true.yml +1 -1
  55. data/spec/cassettes/ElasticAdapter_Index/_validate.yml +2 -2
  56. data/spec/{index → integration/index}/aggregation_spec.rb +10 -2
  57. data/spec/{index → integration/index}/count_spec.rb +5 -10
  58. data/spec/{index → integration/index}/create_index_spec.rb +0 -0
  59. data/spec/{index → integration/index}/delete_index_spec.rb +0 -0
  60. data/spec/{index → integration/index}/get_spec.rb +8 -1
  61. data/spec/integration/index/index_spec.rb +28 -0
  62. data/spec/{index → integration/index}/search_spec.rb +2 -2
  63. data/spec/{index → integration/index}/shared_context.rb +0 -0
  64. data/spec/{index → integration/index}/shared_examples.rb +2 -2
  65. data/spec/{index → integration/index}/suggest_spec.rb +2 -6
  66. data/spec/{index → integration/index}/unit_spec.rb +0 -0
  67. data/spec/{index → integration/index}/validate_spec.rb +1 -16
  68. data/spec/{document_type_spec.rb → unit/document_type_spec.rb} +0 -0
  69. data/spec/{elastic_adapter_spec.rb → unit/elastic_adapter_spec.rb} +0 -0
  70. data/spec/unit/index_spec.rb +218 -0
  71. data/spec/unit/response_spec.rb +28 -0
  72. data/spec/unit/responses/with_aggregations_spec.rb +30 -0
  73. data/spec/unit/responses/with_count_spec.rb +22 -0
  74. data/spec/unit/responses/with_exception_spec.rb +17 -0
  75. data/spec/unit/responses/with_hit_spec.rb +49 -0
  76. data/spec/unit/responses/with_hits_spec.rb +79 -0
  77. data/spec/unit/responses/with_suggestions_spec.rb +33 -0
  78. data/spec/unit/responses/with_validations_spec.rb +34 -0
  79. metadata +61 -65
  80. data/lib/elastic_adapter/responses/aggregation_response.rb +0 -28
  81. data/lib/elastic_adapter/responses/base_response.rb +0 -28
  82. data/lib/elastic_adapter/responses/count_response.rb +0 -13
  83. data/lib/elastic_adapter/responses/get_response.rb +0 -13
  84. data/lib/elastic_adapter/responses/response_decorator_factory.rb +0 -28
  85. data/lib/elastic_adapter/responses/sanitized_response.rb +0 -46
  86. data/lib/elastic_adapter/responses/search_response.rb +0 -33
  87. data/lib/elastic_adapter/responses/suggestion_response.rb +0 -46
  88. data/lib/elastic_adapter/responses/validation_response.rb +0 -18
  89. data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/is_a_response.yml +0 -30
  90. data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/number.yml +0 -57
  91. data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index/is_a_response.yml +0 -30
  92. data/spec/index/index_spec.rb +0 -60
  93. data/spec/responses/aggregation_response_spec.rb +0 -57
  94. data/spec/responses/base_response_spec.rb +0 -19
  95. data/spec/responses/count_response_spec.rb +0 -24
  96. data/spec/responses/get_response_spec.rb +0 -29
  97. data/spec/responses/response_decorator_factory_spec.rb +0 -126
  98. data/spec/responses/sanitized_response_spec.rb +0 -36
  99. data/spec/responses/search_response_spec.rb +0 -122
  100. data/spec/responses/suggestion_response_spec.rb +0 -63
  101. data/spec/responses/validation_response_spec.rb +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41bc711f93edbf4976d4dad92a787e08b86063c1
4
- data.tar.gz: f33c72a1b44eae20a56d15c9ec580a8581d1b22b
3
+ metadata.gz: 901b49ff68803afe86d9f34df44a74bf4a763c20
4
+ data.tar.gz: a60382f88af95ecd4f827436e82e28a35ce3141a
5
5
  SHA512:
6
- metadata.gz: 60f618f24a7967f57b2e04249dc798d7f89dd7de69fb6fd7ecd051e4c7ca3ce5455b6fa9c9f9c541188818245bf272b05895386c67f895ea5342f954b6097f82
7
- data.tar.gz: 0036875c1887e806c9455f808e34a58c0372cb67729d589c5373f4be25f9d02490c5821f34637df9a196e6762cf60296adb622d71e78227811b95a27f2375f90
6
+ metadata.gz: c210df90a3fb29054c629f3a6d2138b45e4a2da6b34a0250a291acb58fe18d9919e37b8b5d88bf727691c6ff0cd3cfcd47bb3cf5bcb09a8de2d07b278db29c52
7
+ data.tar.gz: aaf13649c527376f157f09c4d007296cc7f1360d9baba31a38ef43f08ea5ef277a6cd94bffadbc8dcf77edae18bc7ea8a685ebe8d5564bf54818973be5d2c6c7
data/.codeclimate.yml ADDED
@@ -0,0 +1,8 @@
1
+ engines:
2
+ # to turn on an engine, add it here and set enabled to `true`
3
+ # # to turn off an engine, set enabled to `false` or remove it
4
+ rubocop:
5
+ enabled: true
6
+ ratings:
7
+ paths:
8
+ - lib/**
@@ -29,6 +29,8 @@ module ElasticAdapter
29
29
  class Index
30
30
  attr_reader :name, :settings, :document_type, :url, :log, :client
31
31
 
32
+ ELASTICSEARCH_ERRORS = [Elasticsearch::Transport::Transport::Error]
33
+
32
34
  # @param [Hash] params
33
35
  # @option params [String] :name required
34
36
  # @option params [Hash] :settings required
@@ -87,9 +89,7 @@ module ElasticAdapter
87
89
  def count(query = { query: { match_all: {} } })
88
90
  response = handle_api_call :count do
89
91
  client.count index: name, body: query
90
- end
91
-
92
- response.count || response
92
+ end.extend(Responses::WithCount)
93
93
  end
94
94
 
95
95
  # Indexes a Hash or anything that responds to to_hash as a document
@@ -133,7 +133,7 @@ module ElasticAdapter
133
133
  type: document_type.name,
134
134
  id: id
135
135
  )
136
- end
136
+ end.extend(Responses::WithHit)
137
137
  end
138
138
 
139
139
  # Searches the index for documents matching the passed query.
@@ -153,6 +153,9 @@ module ElasticAdapter
153
153
  body: query
154
154
  )
155
155
  end
156
+ .extend(Responses::WithSuggestions)
157
+ .extend(Responses::WithAggregations)
158
+ .extend(Responses::WithHits)
156
159
  end
157
160
 
158
161
  # Searches the index for suggestions for the passed suggest query
@@ -166,12 +169,12 @@ module ElasticAdapter
166
169
  # @param [Hash] query
167
170
  # @return [ElasticAdapter::SuggestResponse]
168
171
  def suggest(query)
169
- handle_api_call :suggestion do
172
+ handle_api_call do
170
173
  client.suggest(
171
174
  index: name,
172
175
  body: query
173
176
  )
174
- end
177
+ end.extend(Responses::WithSuggestions)
175
178
  end
176
179
 
177
180
  # Validates the passed query
@@ -181,13 +184,13 @@ module ElasticAdapter
181
184
  # @param [Hash] query
182
185
  # @return [ElasticAdapter::ValidationResponse]
183
186
  def validate(query)
184
- handle_api_call :validation do
187
+ handle_api_call do
185
188
  client.indices.validate_query(
186
189
  index: name,
187
190
  explain: true,
188
191
  body: query
189
192
  )
190
- end
193
+ end.extend(Responses::WithValidations)
191
194
  end
192
195
 
193
196
  # Executes a search request and wraps the response in an AggregationResponse
@@ -195,22 +198,20 @@ module ElasticAdapter
195
198
  # @param [Hash] query
196
199
  # @return [ElasticAdapter::Decoration::AggregationResponse]
197
200
  def aggregate(query)
198
- handle_api_call :aggregation do
201
+ handle_api_call do
199
202
  client.search(
200
203
  index: name,
201
204
  body: query
202
205
  )
203
- end
206
+ end.extend(Responses::WithAggregations)
204
207
  end
205
208
 
206
209
  private
207
210
 
208
211
  def handle_api_call(*args)
209
- Responses::ResponseDecoratorFactory.decorate(yield, *args)
210
- rescue Elasticsearch::Transport::Transport::Error => e
211
- Responses::SanitizedResponse.new(
212
- exception: e
213
- )
212
+ Response.new(yield)
213
+ rescue *ELASTICSEARCH_ERRORS => e
214
+ Response.new(exception: e).extend(Responses::WithException)
214
215
  end
215
216
  end
216
217
  end
@@ -0,0 +1,25 @@
1
+ require "delegate"
2
+
3
+ module ElasticAdapter
4
+ class Response < SimpleDelegator
5
+ def initialize(object)
6
+ __setobj__(symbolize_keys(object))
7
+ end
8
+
9
+ def object
10
+ __getobj__
11
+ end
12
+
13
+ private
14
+
15
+ def symbolize_keys(obj)
16
+ if obj.is_a? Hash
17
+ Hash[obj.map { |k, v| [k.to_sym, symbolize_keys(v)] }]
18
+ elsif obj.is_a? Array
19
+ obj.map { |e| symbolize_keys(e) }
20
+ else
21
+ obj
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ module ElasticAdapter
2
+ module Responses
3
+ module WithAggregations
4
+ def aggregations
5
+ object.fetch(:aggregations, {})
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module ElasticAdapter
2
+ module Responses
3
+ module WithCount
4
+ def count
5
+ object.fetch(:count, 0)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module ElasticAdapter
2
+ module Responses
3
+ module WithException
4
+ def exception
5
+ object.fetch(:exception)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,24 @@
1
+ module ElasticAdapter
2
+ module Responses
3
+ module WithHit
4
+ class Hit < SimpleDelegator
5
+ attr_reader :version
6
+
7
+ def initialize(response)
8
+ response = response.dup
9
+ @found = response.delete(:found)
10
+ @version = response.delete(:version)
11
+ __setobj__(response)
12
+ end
13
+
14
+ def found?
15
+ @found
16
+ end
17
+ end
18
+
19
+ def hit
20
+ @hit ||= Hit.new(object)
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,18 @@
1
+ module ElasticAdapter
2
+ module Responses
3
+ module WithHits
4
+ class Hits < SimpleDelegator
5
+ attr_reader :count
6
+
7
+ def initialize(response)
8
+ @count = response.fetch(:hits, {}).fetch(:total, 0)
9
+ __setobj__(response.fetch(:hits, {}).fetch(:hits, []))
10
+ end
11
+ end
12
+
13
+ def hits
14
+ @hits ||= Hits.new(object)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,9 @@
1
+ module ElasticAdapter
2
+ module Responses
3
+ module WithSuggestions
4
+ def suggestions
5
+ object.fetch(:suggest, {})
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ module ElasticAdapter
2
+ module Responses
3
+ module WithValidations
4
+ def explanations
5
+ object.fetch(:explanations, [])
6
+ end
7
+
8
+ def valid?
9
+ object[:valid]
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module ElasticAdapter
2
- VERSION = "0.0.8"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -2,16 +2,15 @@ require "elasticsearch"
2
2
 
3
3
  require "elastic_adapter/version"
4
4
  require "elastic_adapter/document_type"
5
+ require "elastic_adapter/response"
5
6
 
6
- require "elastic_adapter/responses/base_response"
7
- require "elastic_adapter/responses/sanitized_response"
8
- require "elastic_adapter/responses/aggregation_response"
9
- require "elastic_adapter/responses/count_response"
10
- require "elastic_adapter/responses/get_response"
11
- require "elastic_adapter/responses/search_response"
12
- require "elastic_adapter/responses/suggestion_response"
13
- require "elastic_adapter/responses/validation_response"
14
- require "elastic_adapter/responses/response_decorator_factory"
7
+ require "elastic_adapter/responses/with_exception"
8
+ require "elastic_adapter/responses/with_aggregations"
9
+ require "elastic_adapter/responses/with_validations"
10
+ require "elastic_adapter/responses/with_suggestions"
11
+ require "elastic_adapter/responses/with_hits"
12
+ require "elastic_adapter/responses/with_hit"
13
+ require "elastic_adapter/responses/with_count"
15
14
 
16
15
  require "elastic_adapter/index"
17
16
 
@@ -21,10 +21,10 @@ http_interactions:
21
21
  Content-Type:
22
22
  - application/json; charset=UTF-8
23
23
  Content-Length:
24
- - '483'
24
+ - '362'
25
25
  body:
26
26
  encoding: UTF-8
27
- string: '{"took":7,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":2,"max_score":1.0,"hits":[{"_index":"test_index","_type":"test_doc","_id":"AUv-oTm7Ngm7ooYjXOfD","_score":1.0,"_source":{"foo":"bar","group":"A"}},{"_index":"test_index","_type":"test_doc","_id":"AUv-n2n-Ngm7ooYjXOVX","_score":1.0,"_source":{"foo":"bar","group":"A"}}]},"aggregations":{"group":{"doc_count_error_upper_bound":0,"sum_other_doc_count":0,"buckets":[{"key":"a","doc_count":2}]}}}'
27
+ string: '{"took":4,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"test_index","_type":"test_doc","_id":"AU_7DbDscLMsSRqdq03G","_score":1.0,"_source":{"foo":"bar","group":"A"}}]},"aggregations":{"group":{"doc_count_error_upper_bound":0,"sum_other_doc_count":0,"buckets":[{"key":"a","doc_count":1}]}}}'
28
28
  http_version:
29
- recorded_at: Mon, 09 Mar 2015 13:02:38 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:33:51 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -0,0 +1,30 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:9200/test_index/_search
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"aggs":{"group":{"terms":{"field":"group"}}}}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Content-Length:
24
+ - '363'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"took":95,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"test_index","_type":"test_doc","_id":"AU_7DbDscLMsSRqdq03G","_score":1.0,"_source":{"foo":"bar","group":"A"}}]},"aggregations":{"group":{"doc_count_error_upper_bound":0,"sum_other_doc_count":0,"buckets":[{"key":"a","doc_count":1}]}}}'
28
+ http_version:
29
+ recorded_at: Wed, 23 Sep 2015 16:33:51 GMT
30
+ recorded_with: VCR 2.9.3
@@ -15,18 +15,18 @@ http_interactions:
15
15
  - "*/*"
16
16
  response:
17
17
  status:
18
- code: 400
19
- message: Bad Request
18
+ code: 200
19
+ message: OK
20
20
  headers:
21
21
  Content-Type:
22
22
  - application/json; charset=UTF-8
23
23
  Content-Length:
24
- - '81'
24
+ - '21'
25
25
  body:
26
26
  encoding: UTF-8
27
- string: '{"error":"IndexAlreadyExistsException[[test_index] already exists]","status":400}'
27
+ string: '{"acknowledged":true}'
28
28
  http_version:
29
- recorded_at: Mon, 09 Mar 2015 13:02:33 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:33:39 GMT
30
30
  - request:
31
31
  method: post
32
32
  uri: http://localhost:9200/test_index/test_doc
@@ -51,9 +51,9 @@ http_interactions:
51
51
  - '99'
52
52
  body:
53
53
  encoding: UTF-8
54
- string: '{"_index":"test_index","_type":"test_doc","_id":"AUv-oTm7Ngm7ooYjXOfD","_version":1,"created":true}'
54
+ string: '{"_index":"test_index","_type":"test_doc","_id":"AU_7DbDscLMsSRqdq03G","_version":1,"created":true}'
55
55
  http_version:
56
- recorded_at: Mon, 09 Mar 2015 13:02:33 GMT
56
+ recorded_at: Wed, 23 Sep 2015 16:33:42 GMT
57
57
  - request:
58
58
  method: delete
59
59
  uri: http://localhost:9200/test_index
@@ -80,5 +80,5 @@ http_interactions:
80
80
  encoding: UTF-8
81
81
  string: '{"acknowledged":true}'
82
82
  http_version:
83
- recorded_at: Mon, 09 Mar 2015 13:23:53 GMT
83
+ recorded_at: Wed, 23 Sep 2015 16:33:51 GMT
84
84
  recorded_with: VCR 2.9.3
@@ -15,16 +15,16 @@ http_interactions:
15
15
  - "*/*"
16
16
  response:
17
17
  status:
18
- code: 404
19
- message: Not Found
18
+ code: 200
19
+ message: OK
20
20
  headers:
21
21
  Content-Type:
22
22
  - application/json; charset=UTF-8
23
23
  Content-Length:
24
- - '68'
24
+ - '59'
25
25
  body:
26
26
  encoding: UTF-8
27
- string: '{"error":"IndexMissingException[[test_index] missing]","status":404}'
27
+ string: '{"count":0,"_shards":{"total":5,"successful":5,"failed":0}}'
28
28
  http_version:
29
- recorded_at: Mon, 09 Mar 2015 18:08:20 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:33:55 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"count":0,"_shards":{"total":5,"successful":5,"failed":0}}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:08 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:33:55 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,7 +26,7 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"acknowledged":true}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:05 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:33:52 GMT
30
30
  - request:
31
31
  method: delete
32
32
  uri: http://localhost:9200/test_index
@@ -53,5 +53,5 @@ http_interactions:
53
53
  encoding: UTF-8
54
54
  string: '{"acknowledged":true}'
55
55
  http_version:
56
- recorded_at: Sat, 07 Feb 2015 19:44:08 GMT
56
+ recorded_at: Wed, 23 Sep 2015 16:33:55 GMT
57
57
  recorded_with: VCR 2.9.3
@@ -15,16 +15,16 @@ http_interactions:
15
15
  - "*/*"
16
16
  response:
17
17
  status:
18
- code: 404
19
- message: Not Found
18
+ code: 200
19
+ message: OK
20
20
  headers:
21
21
  Content-Type:
22
22
  - application/json; charset=UTF-8
23
23
  Content-Length:
24
- - '68'
24
+ - '59'
25
25
  body:
26
26
  encoding: UTF-8
27
- string: '{"error":"IndexMissingException[[test_index] missing]","status":404}'
27
+ string: '{"count":1,"_shards":{"total":5,"successful":5,"failed":0}}'
28
28
  http_version:
29
- recorded_at: Mon, 09 Mar 2015 18:08:41 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:01 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"count":1,"_shards":{"total":5,"successful":5,"failed":0}}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:14 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:01 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,7 +26,7 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"acknowledged":true}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:08 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:33:55 GMT
30
30
  - request:
31
31
  method: post
32
32
  uri: http://localhost:9200/test_index/test_doc
@@ -51,9 +51,9 @@ http_interactions:
51
51
  - '99'
52
52
  body:
53
53
  encoding: UTF-8
54
- string: '{"_index":"test_index","_type":"test_doc","_id":"AUtlkiRsm1jcpZVj70ky","_version":1,"created":true}'
54
+ string: '{"_index":"test_index","_type":"test_doc","_id":"AU_7De5LcLMsSRqdq03H","_version":1,"created":true}'
55
55
  http_version:
56
- recorded_at: Sat, 07 Feb 2015 19:44:11 GMT
56
+ recorded_at: Wed, 23 Sep 2015 16:33:58 GMT
57
57
  - request:
58
58
  method: delete
59
59
  uri: http://localhost:9200/test_index
@@ -80,5 +80,5 @@ http_interactions:
80
80
  encoding: UTF-8
81
81
  string: '{"acknowledged":true}'
82
82
  http_version:
83
- recorded_at: Sat, 07 Feb 2015 19:44:14 GMT
83
+ recorded_at: Wed, 23 Sep 2015 16:34:01 GMT
84
84
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"error":"IndexAlreadyExistsException[[test_index] already exists]","status":400}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:17 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:04 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"error":"IndexAlreadyExistsException[[test_index] already exists]","status":400}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:17 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:04 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,7 +26,7 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"acknowledged":true}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:14 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:01 GMT
30
30
  - request:
31
31
  method: delete
32
32
  uri: http://localhost:9200/test_index
@@ -53,5 +53,5 @@ http_interactions:
53
53
  encoding: UTF-8
54
54
  string: '{"acknowledged":true}'
55
55
  http_version:
56
- recorded_at: Sat, 07 Feb 2015 19:44:17 GMT
56
+ recorded_at: Wed, 23 Sep 2015 16:34:04 GMT
57
57
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"acknowledged":true}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:17 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:04 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"acknowledged":true}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:17 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:04 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"acknowledged":true}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:17 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:04 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"error":"IndexMissingException[[test_index] missing]","status":404}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:23 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:11 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"error":"IndexMissingException[[test_index] missing]","status":404}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:23 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:11 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"acknowledged":true}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:23 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:11 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"acknowledged":true}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:20 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:07 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"acknowledged":true}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:20 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:07 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"error":"IndexAlreadyExistsException[[test_index] already exists]","status":400}'
28
28
  http_version:
29
- recorded_at: Sat, 07 Feb 2015 19:44:17 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:04 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"_index":"test_index","_type":"test_doc","_id":"1","_version":1,"found":true,"_source":{"foo":"bar"}}'
28
28
  http_version:
29
- recorded_at: Mon, 09 Mar 2015 17:55:30 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:17 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -26,7 +26,7 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"acknowledged":true}'
28
28
  http_version:
29
- recorded_at: Mon, 09 Mar 2015 17:55:27 GMT
29
+ recorded_at: Wed, 23 Sep 2015 16:34:11 GMT
30
30
  - request:
31
31
  method: put
32
32
  uri: http://localhost:9200/test_index/test_doc/1
@@ -53,7 +53,7 @@ http_interactions:
53
53
  encoding: UTF-8
54
54
  string: '{"_index":"test_index","_type":"test_doc","_id":"1","_version":1,"created":true}'
55
55
  http_version:
56
- recorded_at: Mon, 09 Mar 2015 17:55:27 GMT
56
+ recorded_at: Wed, 23 Sep 2015 16:34:14 GMT
57
57
  - request:
58
58
  method: delete
59
59
  uri: http://localhost:9200/test_index
@@ -80,5 +80,5 @@ http_interactions:
80
80
  encoding: UTF-8
81
81
  string: '{"acknowledged":true}'
82
82
  http_version:
83
- recorded_at: Mon, 09 Mar 2015 17:55:38 GMT
83
+ recorded_at: Wed, 23 Sep 2015 16:34:17 GMT
84
84
  recorded_with: VCR 2.9.3