elastic_adapter 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +3 -0
  3. data/.rubocop.yml +8 -0
  4. data/.ruby.yml +261 -0
  5. data/.travis.yml +6 -0
  6. data/README.md +87 -8
  7. data/elastic_adapter.gemspec +1 -0
  8. data/examples/basic_usage.rb +164 -0
  9. data/lib/elastic_adapter/decoration/count_response.rb +0 -2
  10. data/lib/elastic_adapter/decoration/decorator.rb +2 -4
  11. data/lib/elastic_adapter/decoration/response_decorator_factory.rb +3 -6
  12. data/lib/elastic_adapter/decoration/search_response.rb +0 -2
  13. data/lib/elastic_adapter/decoration/suggestion_response.rb +0 -1
  14. data/lib/elastic_adapter/decoration/validation_response.rb +0 -1
  15. data/lib/elastic_adapter/document_type.rb +12 -2
  16. data/lib/elastic_adapter/index.rb +103 -10
  17. data/lib/elastic_adapter/response.rb +2 -1
  18. data/lib/elastic_adapter/version.rb +1 -1
  19. data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/is_a_response.yml +1 -1
  20. data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/{returs_the_amount_of_all_documents.yml → returns_the_amount_of_all_documents.yml} +1 -1
  21. data/spec/cassettes/ElasticAdapter_Index/_count/empty_index.yml +57 -0
  22. data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index/is_a_response.yml +1 -1
  23. data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index/returns_1.yml +1 -1
  24. data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index.yml +84 -0
  25. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present/response/has_an_exception.yml +2 -2
  26. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present/response/is_a_Response.yml +2 -2
  27. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present.yml +57 -0
  28. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response/has_no_exception.yml +2 -29
  29. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response/is_a_Response.yml +2 -29
  30. data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response.yml +30 -0
  31. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_not_present/repsonse/has_an_exception.yml +1 -1
  32. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_not_present/repsonse/is_a_Response.yml +1 -1
  33. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/has_no_exception.yml +1 -28
  34. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/has_no_exceptionElasticAdapter_Index/_delete_index/index_present/repsonse.yml +30 -0
  35. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/is_a_Response.yml +1 -28
  36. data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/is_a_ResponseElasticAdapter_Index/_delete_index/index_present/repsonse.yml +30 -0
  37. data/spec/cassettes/ElasticAdapter_Index/_get/document_exists/response/contains_the_document.yml +1 -1
  38. data/spec/cassettes/ElasticAdapter_Index/_get/document_exists.yml +84 -0
  39. data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/doesn_t_change_the_document_count.yml +3 -3
  40. data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/invokes_to_hash_on_the_document.yml +1 -1
  41. data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/updates_the_document.yml +1 -1
  42. data/spec/cassettes/ElasticAdapter_Index/_index/existing_document.yml +84 -0
  43. data/spec/cassettes/ElasticAdapter_Index/_index/new_document/indexes_a_document.yml +3 -3
  44. data/spec/cassettes/ElasticAdapter_Index/_index/new_document/invokes_to_hash_on_the_document.yml +2 -2
  45. data/spec/cassettes/ElasticAdapter_Index/_index/new_document.yml +57 -0
  46. data/spec/cassettes/ElasticAdapter_Index/_search/match_all/returns_all_documents.yml +3 -3
  47. data/spec/cassettes/ElasticAdapter_Index/_search/zoo/returns_one_document.yml +3 -3
  48. data/spec/cassettes/ElasticAdapter_Index/_search/zoo/returns_the_wanted_document.yml +3 -3
  49. data/spec/cassettes/ElasticAdapter_Index/_search.yml +111 -0
  50. data/spec/cassettes/ElasticAdapter_Index/_suggest/query_ba_/returns_bar.yml +2 -2
  51. data/spec/cassettes/ElasticAdapter_Index/_suggest/query_ba_/returns_one_result.yml +2 -2
  52. data/spec/cassettes/ElasticAdapter_Index/_suggest.yml +111 -0
  53. data/spec/cassettes/ElasticAdapter_Index/_validate/invalid_query/is_a_response.yml +4 -3
  54. data/spec/cassettes/ElasticAdapter_Index/_validate/invalid_query/is_false.yml +1 -1
  55. data/spec/cassettes/ElasticAdapter_Index/_validate/valid_query/is_a_response.yml +3 -3
  56. data/spec/cassettes/ElasticAdapter_Index/_validate/valid_query/is_true.yml +1 -1
  57. data/spec/cassettes/ElasticAdapter_Index/_validate.yml +57 -0
  58. data/spec/index/count_spec.rb +46 -0
  59. data/spec/index/create_index_spec.rb +39 -0
  60. data/spec/index/delete_index_spec.rb +29 -0
  61. data/spec/index/get_spec.rb +29 -0
  62. data/spec/index/index_spec.rb +60 -0
  63. data/spec/index/search_spec.rb +37 -0
  64. data/spec/index/shared_context.rb +37 -0
  65. data/spec/index/shared_examples.rb +19 -0
  66. data/spec/index/suggest_spec.rb +44 -0
  67. data/spec/index/unit_spec.rb +69 -0
  68. data/spec/index/validate_spec.rb +55 -0
  69. data/spec/spec_helper.rb +6 -1
  70. data/spec/support/index_helper.rb +78 -0
  71. metadata +72 -7
  72. data/spec/index_spec.rb +0 -458
@@ -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_doc":{"properties":{"foo":{"type":"string"},"foo_suggest":{"type":"completion"}}}},"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: Sat, 07 Feb 2015 19:44:20 GMT
30
+ recorded_with: VCR 2.9.3
@@ -1,32 +1,5 @@
1
1
  ---
2
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
3
  - request:
31
4
  method: delete
32
5
  uri: http://localhost:9200/test_index
@@ -53,5 +26,5 @@ http_interactions:
53
26
  encoding: UTF-8
54
27
  string: '{"acknowledged":true}'
55
28
  http_version:
56
- recorded_at: Thu, 05 Feb 2015 19:30:15 GMT
29
+ recorded_at: Sat, 07 Feb 2015 19:44:20 GMT
57
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_doc":{"properties":{"foo":{"type":"string"},"foo_suggest":{"type":"completion"}}}},"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: 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: Sat, 07 Feb 2015 19:44:17 GMT
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: Thu, 05 Feb 2015 19:30:08 GMT
29
+ recorded_at: Sat, 07 Feb 2015 19:44:29 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -0,0 +1,84 @@
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"},"foo_suggest":{"type":"completion"}}}},"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: Sat, 07 Feb 2015 19:44:23 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":"bar"}'
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: 201
46
+ message: Created
47
+ headers:
48
+ Content-Type:
49
+ - application/json; charset=UTF-8
50
+ Content-Length:
51
+ - '80'
52
+ body:
53
+ encoding: UTF-8
54
+ string: '{"_index":"test_index","_type":"test_doc","_id":"1","_version":1,"created":true}'
55
+ http_version:
56
+ recorded_at: Sat, 07 Feb 2015 19:44:26 GMT
57
+ - request:
58
+ method: delete
59
+ uri: http://localhost:9200/test_index
60
+ body:
61
+ encoding: US-ASCII
62
+ string: ''
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
+ - '21'
79
+ body:
80
+ encoding: UTF-8
81
+ string: '{"acknowledged":true}'
82
+ http_version:
83
+ recorded_at: Sat, 07 Feb 2015 19:44:29 GMT
84
+ recorded_with: VCR 2.9.3
@@ -26,7 +26,7 @@ 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: Thu, 05 Feb 2015 19:30:11 GMT
29
+ recorded_at: Sat, 07 Feb 2015 20:12:56 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":2,"created":false}'
55
55
  http_version:
56
- recorded_at: Thu, 05 Feb 2015 19:30:11 GMT
56
+ recorded_at: Sat, 07 Feb 2015 20:12:56 GMT
57
57
  - request:
58
58
  method: get
59
59
  uri: http://localhost:9200/test_index/_count
@@ -80,5 +80,5 @@ http_interactions:
80
80
  encoding: UTF-8
81
81
  string: '{"count":1,"_shards":{"total":5,"successful":5,"failed":0}}'
82
82
  http_version:
83
- recorded_at: Thu, 05 Feb 2015 19:30:12 GMT
83
+ recorded_at: Sat, 07 Feb 2015 20:12:56 GMT
84
84
  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":3,"created":false}'
28
28
  http_version:
29
- recorded_at: Thu, 05 Feb 2015 19:30:12 GMT
29
+ recorded_at: Sat, 07 Feb 2015 20:12:56 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":3,"found":true,"_source":{"foo":"baz"}}'
28
28
  http_version:
29
- recorded_at: Thu, 05 Feb 2015 19:30:12 GMT
29
+ recorded_at: Sat, 07 Feb 2015 20:12:56 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -0,0 +1,84 @@
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"},"foo_suggest":{"type":"completion"}}}},"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: Sat, 07 Feb 2015 20:12:50 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":"bar"}'
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: 201
46
+ message: Created
47
+ headers:
48
+ Content-Type:
49
+ - application/json; charset=UTF-8
50
+ Content-Length:
51
+ - '80'
52
+ body:
53
+ encoding: UTF-8
54
+ string: '{"_index":"test_index","_type":"test_doc","_id":"1","_version":1,"created":true}'
55
+ http_version:
56
+ recorded_at: Sat, 07 Feb 2015 20:12:53 GMT
57
+ - request:
58
+ method: delete
59
+ uri: http://localhost:9200/test_index
60
+ body:
61
+ encoding: US-ASCII
62
+ string: ''
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
+ - '21'
79
+ body:
80
+ encoding: UTF-8
81
+ string: '{"acknowledged":true}'
82
+ http_version:
83
+ recorded_at: Sat, 07 Feb 2015 20:12:56 GMT
84
+ recorded_with: VCR 2.9.3
@@ -24,9 +24,9 @@ http_interactions:
24
24
  - '99'
25
25
  body:
26
26
  encoding: UTF-8
27
- string: '{"_index":"test_index","_type":"test_doc","_id":"AUtbOJDgdWZWWFrzEIWU","_version":1,"created":true}'
27
+ string: '{"_index":"test_index","_type":"test_doc","_id":"AUtlrFrTm1jcpZVj70k1","_version":1,"created":true}'
28
28
  http_version:
29
- recorded_at: Thu, 05 Feb 2015 19:30:08 GMT
29
+ recorded_at: Sat, 07 Feb 2015 20:12:49 GMT
30
30
  - request:
31
31
  method: get
32
32
  uri: http://localhost:9200/test_index/_count
@@ -53,5 +53,5 @@ http_interactions:
53
53
  encoding: UTF-8
54
54
  string: '{"count":1,"_shards":{"total":5,"successful":5,"failed":0}}'
55
55
  http_version:
56
- recorded_at: Thu, 05 Feb 2015 19:30:09 GMT
56
+ recorded_at: Sat, 07 Feb 2015 20:12:50 GMT
57
57
  recorded_with: VCR 2.9.3
@@ -24,7 +24,7 @@ http_interactions:
24
24
  - '99'
25
25
  body:
26
26
  encoding: UTF-8
27
- string: '{"_index":"test_index","_type":"test_doc","_id":"AUtbOJUndWZWWFrzEIWV","_version":1,"created":true}'
27
+ string: '{"_index":"test_index","_type":"test_doc","_id":"AUtlrF7cm1jcpZVj70k2","_version":1,"created":true}'
28
28
  http_version:
29
- recorded_at: Thu, 05 Feb 2015 19:30:09 GMT
29
+ recorded_at: Sat, 07 Feb 2015 20:12:50 GMT
30
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"},"foo_suggest":{"type":"completion"}}}},"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: Sat, 07 Feb 2015 20:12:46 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: Sat, 07 Feb 2015 20:12:50 GMT
57
+ recorded_with: VCR 2.9.3
@@ -21,10 +21,10 @@ http_interactions:
21
21
  Content-Type:
22
22
  - application/json; charset=UTF-8
23
23
  Content-Length:
24
- - '300'
24
+ - '360'
25
25
  body:
26
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"}}]}}'
27
+ string: '{"took":3,"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","foo_suggest":{"input":"bar"}}},{"_index":"test_index","_type":"test_doc","_id":"2","_score":1.0,"_source":{"foo":"zoo","foo_suggest":{"input":"zoo"}}}]}}'
28
28
  http_version:
29
- recorded_at: Thu, 05 Feb 2015 19:30:08 GMT
29
+ recorded_at: Sat, 07 Feb 2015 19:44:49 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -21,10 +21,10 @@ http_interactions:
21
21
  Content-Type:
22
22
  - application/json; charset=UTF-8
23
23
  Content-Length:
24
- - '224'
24
+ - '254'
25
25
  body:
26
26
  encoding: UTF-8
27
- string: '{"took":4,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.30685282,"hits":[{"_index":"test_index","_type":"test_doc","_id":"2","_score":0.30685282,"_source":{"foo":"zoo"}}]}}'
27
+ string: '{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.30685282,"hits":[{"_index":"test_index","_type":"test_doc","_id":"2","_score":0.30685282,"_source":{"foo":"zoo","foo_suggest":{"input":"zoo"}}}]}}'
28
28
  http_version:
29
- recorded_at: Thu, 05 Feb 2015 19:30:08 GMT
29
+ recorded_at: Sat, 07 Feb 2015 19:44:49 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -21,10 +21,10 @@ http_interactions:
21
21
  Content-Type:
22
22
  - application/json; charset=UTF-8
23
23
  Content-Length:
24
- - '224'
24
+ - '254'
25
25
  body:
26
26
  encoding: UTF-8
27
- string: '{"took":3,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.30685282,"hits":[{"_index":"test_index","_type":"test_doc","_id":"2","_score":0.30685282,"_source":{"foo":"zoo"}}]}}'
27
+ string: '{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.30685282,"hits":[{"_index":"test_index","_type":"test_doc","_id":"2","_score":0.30685282,"_source":{"foo":"zoo","foo_suggest":{"input":"zoo"}}}]}}'
28
28
  http_version:
29
- recorded_at: Thu, 05 Feb 2015 19:30:08 GMT
29
+ recorded_at: Sat, 07 Feb 2015 19:44:49 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -0,0 +1,111 @@
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"},"foo_suggest":{"type":"completion"}}}},"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: Sat, 07 Feb 2015 19:44:40 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":"bar","foo_suggest":{"input":"bar"}}'
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: 201
46
+ message: Created
47
+ headers:
48
+ Content-Type:
49
+ - application/json; charset=UTF-8
50
+ Content-Length:
51
+ - '80'
52
+ body:
53
+ encoding: UTF-8
54
+ string: '{"_index":"test_index","_type":"test_doc","_id":"1","_version":1,"created":true}'
55
+ http_version:
56
+ recorded_at: Sat, 07 Feb 2015 19:44:43 GMT
57
+ - request:
58
+ method: put
59
+ uri: http://localhost:9200/test_index/test_doc/2
60
+ body:
61
+ encoding: UTF-8
62
+ string: '{"foo":"zoo","foo_suggest":{"input":"zoo"}}'
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: 201
73
+ message: Created
74
+ headers:
75
+ Content-Type:
76
+ - application/json; charset=UTF-8
77
+ Content-Length:
78
+ - '80'
79
+ body:
80
+ encoding: UTF-8
81
+ string: '{"_index":"test_index","_type":"test_doc","_id":"2","_version":1,"created":true}'
82
+ http_version:
83
+ recorded_at: Sat, 07 Feb 2015 19:44:46 GMT
84
+ - request:
85
+ method: delete
86
+ uri: http://localhost:9200/test_index
87
+ body:
88
+ encoding: US-ASCII
89
+ string: ''
90
+ headers:
91
+ User-Agent:
92
+ - Faraday v0.9.1
93
+ Accept-Encoding:
94
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
95
+ Accept:
96
+ - "*/*"
97
+ response:
98
+ status:
99
+ code: 200
100
+ message: OK
101
+ headers:
102
+ Content-Type:
103
+ - application/json; charset=UTF-8
104
+ Content-Length:
105
+ - '21'
106
+ body:
107
+ encoding: UTF-8
108
+ string: '{"acknowledged":true}'
109
+ http_version:
110
+ recorded_at: Sat, 07 Feb 2015 19:44:49 GMT
111
+ recorded_with: VCR 2.9.3
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: http://localhost:9200/test_index/_suggest
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"foo_suggest":{"text":"ba","completion":{"field":"foo"}}}'
8
+ string: '{"foo_suggest":{"text":"ba","completion":{"field":"foo_suggest"}}}'
9
9
  headers:
10
10
  User-Agent:
11
11
  - Faraday v0.9.1
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"_shards":{"total":5,"successful":5,"failed":0},"foo_suggest":[{"text":"ba","offset":0,"length":2,"options":[{"text":"bar","score":1.0}]}]}'
28
28
  http_version:
29
- recorded_at: Thu, 05 Feb 2015 19:30:07 GMT
29
+ recorded_at: Sat, 07 Feb 2015 19:44:58 GMT
30
30
  recorded_with: VCR 2.9.3
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: http://localhost:9200/test_index/_suggest
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"foo_suggest":{"text":"ba","completion":{"field":"foo"}}}'
8
+ string: '{"foo_suggest":{"text":"ba","completion":{"field":"foo_suggest"}}}'
9
9
  headers:
10
10
  User-Agent:
11
11
  - Faraday v0.9.1
@@ -26,5 +26,5 @@ http_interactions:
26
26
  encoding: UTF-8
27
27
  string: '{"_shards":{"total":5,"successful":5,"failed":0},"foo_suggest":[{"text":"ba","offset":0,"length":2,"options":[{"text":"bar","score":1.0}]}]}'
28
28
  http_version:
29
- recorded_at: Thu, 05 Feb 2015 19:30:07 GMT
29
+ recorded_at: Sat, 07 Feb 2015 19:44:58 GMT
30
30
  recorded_with: VCR 2.9.3