elastic_adapter 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +41 -0
  7. data/Rakefile +24 -0
  8. data/elastic_adapter.gemspec +30 -0
  9. data/example.env +4 -0
  10. data/lib/elastic_adapter/decoration/count_response.rb +18 -0
  11. data/lib/elastic_adapter/decoration/decorator.rb +39 -0
  12. data/lib/elastic_adapter/decoration/hit_decorator.rb +25 -0
  13. data/lib/elastic_adapter/decoration/response_decorator_factory.rb +51 -0
  14. data/lib/elastic_adapter/decoration/search_response.rb +29 -0
  15. data/lib/elastic_adapter/decoration/suggestion_response.rb +25 -0
  16. data/lib/elastic_adapter/decoration/validation_response.rb +16 -0
  17. data/lib/elastic_adapter/document_type.rb +21 -0
  18. data/lib/elastic_adapter/index.rb +108 -0
  19. data/lib/elastic_adapter/response.rb +57 -0
  20. data/lib/elastic_adapter/version.rb +3 -0
  21. data/lib/elastic_adapter.rb +21 -0
  22. data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/is_a_response.yml +30 -0
  23. data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/returs_the_amount_of_all_documents.yml +30 -0
  24. data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index/is_a_response.yml +30 -0
  25. data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index/returns_1.yml +30 -0
  26. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present/response/has_an_exception.yml +30 -0
  27. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present/response/is_a_Response.yml +30 -0
  28. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response/has_no_exception.yml +57 -0
  29. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response/is_a_Response.yml +57 -0
  30. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_not_present/repsonse/has_an_exception.yml +30 -0
  31. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_not_present/repsonse/is_a_Response.yml +30 -0
  32. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/has_no_exception.yml +57 -0
  33. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/is_a_Response.yml +57 -0
  34. data/spec/cassettes/ElasticAdapter_Index/_get/document_exists/response/contains_the_document.yml +30 -0
  35. data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/doesn_t_change_the_document_count.yml +84 -0
  36. data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/invokes_to_hash_on_the_document.yml +30 -0
  37. data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/updates_the_document.yml +30 -0
  38. data/spec/cassettes/ElasticAdapter_Index/_index/new_document/indexes_a_document.yml +57 -0
  39. data/spec/cassettes/ElasticAdapter_Index/_index/new_document/invokes_to_hash_on_the_document.yml +30 -0
  40. data/spec/cassettes/ElasticAdapter_Index/_search/match_all/returns_all_documents.yml +30 -0
  41. data/spec/cassettes/ElasticAdapter_Index/_search/zoo/returns_one_document.yml +30 -0
  42. data/spec/cassettes/ElasticAdapter_Index/_search/zoo/returns_the_wanted_document.yml +30 -0
  43. data/spec/cassettes/ElasticAdapter_Index/_suggest/query_ba_/returns_bar.yml +30 -0
  44. data/spec/cassettes/ElasticAdapter_Index/_suggest/query_ba_/returns_one_result.yml +30 -0
  45. data/spec/cassettes/ElasticAdapter_Index/_validate/invalid_query/is_a_response.yml +30 -0
  46. data/spec/cassettes/ElasticAdapter_Index/_validate/invalid_query/is_false.yml +31 -0
  47. data/spec/cassettes/ElasticAdapter_Index/_validate/valid_query/is_a_response.yml +30 -0
  48. data/spec/cassettes/ElasticAdapter_Index/_validate/valid_query/is_true.yml +30 -0
  49. data/spec/decoration/response_decorator_factory_spec.rb +75 -0
  50. data/spec/document_type_spec.rb +42 -0
  51. data/spec/elastic_adapter_spec.rb +4 -0
  52. data/spec/index_spec.rb +458 -0
  53. data/spec/response_spec.rb +80 -0
  54. data/spec/spec_helper.rb +102 -0
  55. metadata +243 -0
@@ -0,0 +1,30 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:9200/test_index/_count
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"query":{"match_all":{}}}'
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
+ - '59'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"count":1,"_shards":{"total":5,"successful":5,"failed":0}}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
30
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,30 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://localhost:9200/test_index
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"mappings":{"test_index":{"properties":{"foo":{"type":"string"}}}},"settings":{"number_of_shards":1}}'
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: 400
19
+ message: Bad Request
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Content-Length:
24
+ - '81'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"error":"IndexAlreadyExistsException[[test_index] already exists]","status":400}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
30
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,30 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://localhost:9200/test_index
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"mappings":{"test_index":{"properties":{"foo":{"type":"string"}}}},"settings":{"number_of_shards":1}}'
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: 400
19
+ message: Bad Request
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Content-Length:
24
+ - '81'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"error":"IndexAlreadyExistsException[[test_index] already exists]","status":400}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
30
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://localhost:9200/test_index
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"mappings":{"test_index":{"properties":{"foo":{"type":"string"}}}},"settings":{"number_of_shards":1}}'
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
+ - '21'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"acknowledged":true}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
30
+ - request:
31
+ method: delete
32
+ uri: http://localhost:9200/test_index
33
+ body:
34
+ encoding: US-ASCII
35
+ string: ''
36
+ headers:
37
+ User-Agent:
38
+ - Faraday v0.9.1
39
+ Accept-Encoding:
40
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
41
+ Accept:
42
+ - "*/*"
43
+ response:
44
+ status:
45
+ code: 200
46
+ message: OK
47
+ headers:
48
+ Content-Type:
49
+ - application/json; charset=UTF-8
50
+ Content-Length:
51
+ - '21'
52
+ body:
53
+ encoding: UTF-8
54
+ string: '{"acknowledged":true}'
55
+ http_version:
56
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
57
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://localhost:9200/test_index
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"mappings":{"test_index":{"properties":{"foo":{"type":"string"}}}},"settings":{"number_of_shards":1}}'
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
+ - '21'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"acknowledged":true}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
30
+ - request:
31
+ method: delete
32
+ uri: http://localhost:9200/test_index
33
+ body:
34
+ encoding: US-ASCII
35
+ string: ''
36
+ headers:
37
+ User-Agent:
38
+ - Faraday v0.9.1
39
+ Accept-Encoding:
40
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
41
+ Accept:
42
+ - "*/*"
43
+ response:
44
+ status:
45
+ code: 200
46
+ message: OK
47
+ headers:
48
+ Content-Type:
49
+ - application/json; charset=UTF-8
50
+ Content-Length:
51
+ - '21'
52
+ body:
53
+ encoding: UTF-8
54
+ string: '{"acknowledged":true}'
55
+ http_version:
56
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
57
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,30 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: http://localhost:9200/test_index
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
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: 404
19
+ message: Not Found
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Content-Length:
24
+ - '68'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"error":"IndexMissingException[[test_index] missing]","status":404}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
30
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,30 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: http://localhost:9200/test_index
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
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: 404
19
+ message: Not Found
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Content-Length:
24
+ - '68'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"error":"IndexMissingException[[test_index] missing]","status":404}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
30
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://localhost:9200/test_index
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"mappings":{"test_doc":{"properties":{"foo":{"type":"string"}}}},"settings":{}}'
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
+ - '21'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"acknowledged":true}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
30
+ - request:
31
+ method: delete
32
+ uri: http://localhost:9200/test_index
33
+ body:
34
+ encoding: US-ASCII
35
+ string: ''
36
+ headers:
37
+ User-Agent:
38
+ - Faraday v0.9.1
39
+ Accept-Encoding:
40
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
41
+ Accept:
42
+ - "*/*"
43
+ response:
44
+ status:
45
+ code: 200
46
+ message: OK
47
+ headers:
48
+ Content-Type:
49
+ - application/json; charset=UTF-8
50
+ Content-Length:
51
+ - '21'
52
+ body:
53
+ encoding: UTF-8
54
+ string: '{"acknowledged":true}'
55
+ http_version:
56
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
57
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://localhost:9200/test_index
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"mappings":{"test_doc":{"properties":{"foo":{"type":"string"}}}},"settings":{}}'
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
+ - '21'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"acknowledged":true}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
30
+ - request:
31
+ method: delete
32
+ uri: http://localhost:9200/test_index
33
+ body:
34
+ encoding: US-ASCII
35
+ string: ''
36
+ headers:
37
+ User-Agent:
38
+ - Faraday v0.9.1
39
+ Accept-Encoding:
40
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
41
+ Accept:
42
+ - "*/*"
43
+ response:
44
+ status:
45
+ code: 200
46
+ message: OK
47
+ headers:
48
+ Content-Type:
49
+ - application/json; charset=UTF-8
50
+ Content-Length:
51
+ - '21'
52
+ body:
53
+ encoding: UTF-8
54
+ string: '{"acknowledged":true}'
55
+ http_version:
56
+ recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
57
+ 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/test_doc/1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
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
+ - '102'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"_index":"test_index","_type":"test_doc","_id":"1","_version":1,"found":true,"_source":{"foo":"bar"}}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:08 GMT
30
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,84 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:9200/test_index/_count
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"query":{"match_all":{}}}'
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
+ - '59'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"count":1,"_shards":{"total":5,"successful":5,"failed":0}}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:11 GMT
30
+ - request:
31
+ method: put
32
+ uri: http://localhost:9200/test_index/test_doc/1
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"foo":"baz"}'
36
+ headers:
37
+ User-Agent:
38
+ - Faraday v0.9.1
39
+ Accept-Encoding:
40
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
41
+ Accept:
42
+ - "*/*"
43
+ response:
44
+ status:
45
+ code: 200
46
+ message: OK
47
+ headers:
48
+ Content-Type:
49
+ - application/json; charset=UTF-8
50
+ Content-Length:
51
+ - '81'
52
+ body:
53
+ encoding: UTF-8
54
+ string: '{"_index":"test_index","_type":"test_doc","_id":"1","_version":2,"created":false}'
55
+ http_version:
56
+ recorded_at: Thu, 05 Feb 2015 19:30:11 GMT
57
+ - request:
58
+ method: get
59
+ uri: http://localhost:9200/test_index/_count
60
+ body:
61
+ encoding: UTF-8
62
+ string: '{"query":{"match_all":{}}}'
63
+ headers:
64
+ User-Agent:
65
+ - Faraday v0.9.1
66
+ Accept-Encoding:
67
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
68
+ Accept:
69
+ - "*/*"
70
+ response:
71
+ status:
72
+ code: 200
73
+ message: OK
74
+ headers:
75
+ Content-Type:
76
+ - application/json; charset=UTF-8
77
+ Content-Length:
78
+ - '59'
79
+ body:
80
+ encoding: UTF-8
81
+ string: '{"count":1,"_shards":{"total":5,"successful":5,"failed":0}}'
82
+ http_version:
83
+ recorded_at: Thu, 05 Feb 2015 19:30:12 GMT
84
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,30 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://localhost:9200/test_index/test_doc/1
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"foo":"baz"}'
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
+ - '81'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"_index":"test_index","_type":"test_doc","_id":"1","_version":3,"created":false}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:12 GMT
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/test_doc/1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
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
+ - '102'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"_index":"test_index","_type":"test_doc","_id":"1","_version":3,"found":true,"_source":{"foo":"baz"}}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:12 GMT
30
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:9200/test_index/test_doc
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"foo":"bar"}'
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: 201
19
+ message: Created
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Content-Length:
24
+ - '99'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"_index":"test_index","_type":"test_doc","_id":"AUtbOJDgdWZWWFrzEIWU","_version":1,"created":true}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:08 GMT
30
+ - request:
31
+ method: get
32
+ uri: http://localhost:9200/test_index/_count
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"query":{"match_all":{}}}'
36
+ headers:
37
+ User-Agent:
38
+ - Faraday v0.9.1
39
+ Accept-Encoding:
40
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
41
+ Accept:
42
+ - "*/*"
43
+ response:
44
+ status:
45
+ code: 200
46
+ message: OK
47
+ headers:
48
+ Content-Type:
49
+ - application/json; charset=UTF-8
50
+ Content-Length:
51
+ - '59'
52
+ body:
53
+ encoding: UTF-8
54
+ string: '{"count":1,"_shards":{"total":5,"successful":5,"failed":0}}'
55
+ http_version:
56
+ recorded_at: Thu, 05 Feb 2015 19:30:09 GMT
57
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,30 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:9200/test_index/test_doc
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"foo":"bar"}'
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: 201
19
+ message: Created
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Content-Length:
24
+ - '99'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"_index":"test_index","_type":"test_doc","_id":"AUtbOJUndWZWWFrzEIWV","_version":1,"created":true}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:09 GMT
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: '{"query":{"match_all":{}}}'
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
+ - '300'
25
+ body:
26
+ encoding: UTF-8
27
+ string: '{"took":2,"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":"1","_score":1.0,"_source":{"foo":"bar"}},{"_index":"test_index","_type":"test_doc","_id":"2","_score":1.0,"_source":{"foo":"zoo"}}]}}'
28
+ http_version:
29
+ recorded_at: Thu, 05 Feb 2015 19:30:08 GMT
30
+ recorded_with: VCR 2.9.3