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.
- checksums.yaml +4 -4
- data/.hound.yml +3 -0
- data/.rubocop.yml +8 -0
- data/.ruby.yml +261 -0
- data/.travis.yml +6 -0
- data/README.md +87 -8
- data/elastic_adapter.gemspec +1 -0
- data/examples/basic_usage.rb +164 -0
- data/lib/elastic_adapter/decoration/count_response.rb +0 -2
- data/lib/elastic_adapter/decoration/decorator.rb +2 -4
- data/lib/elastic_adapter/decoration/response_decorator_factory.rb +3 -6
- data/lib/elastic_adapter/decoration/search_response.rb +0 -2
- data/lib/elastic_adapter/decoration/suggestion_response.rb +0 -1
- data/lib/elastic_adapter/decoration/validation_response.rb +0 -1
- data/lib/elastic_adapter/document_type.rb +12 -2
- data/lib/elastic_adapter/index.rb +103 -10
- data/lib/elastic_adapter/response.rb +2 -1
- data/lib/elastic_adapter/version.rb +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/is_a_response.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/{returs_the_amount_of_all_documents.yml → returns_the_amount_of_all_documents.yml} +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_count/empty_index.yml +57 -0
- data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index/is_a_response.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index/returns_1.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index.yml +84 -0
- data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present/response/has_an_exception.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present/response/is_a_Response.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present.yml +57 -0
- data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response/has_no_exception.yml +2 -29
- data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response/is_a_Response.yml +2 -29
- data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response.yml +30 -0
- data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_not_present/repsonse/has_an_exception.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_not_present/repsonse/is_a_Response.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/has_no_exception.yml +1 -28
- data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/has_no_exceptionElasticAdapter_Index/_delete_index/index_present/repsonse.yml +30 -0
- data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/is_a_Response.yml +1 -28
- data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/is_a_ResponseElasticAdapter_Index/_delete_index/index_present/repsonse.yml +30 -0
- data/spec/cassettes/ElasticAdapter_Index/_get/document_exists/response/contains_the_document.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_get/document_exists.yml +84 -0
- data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/doesn_t_change_the_document_count.yml +3 -3
- data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/invokes_to_hash_on_the_document.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/updates_the_document.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_index/existing_document.yml +84 -0
- data/spec/cassettes/ElasticAdapter_Index/_index/new_document/indexes_a_document.yml +3 -3
- data/spec/cassettes/ElasticAdapter_Index/_index/new_document/invokes_to_hash_on_the_document.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_index/new_document.yml +57 -0
- data/spec/cassettes/ElasticAdapter_Index/_search/match_all/returns_all_documents.yml +3 -3
- data/spec/cassettes/ElasticAdapter_Index/_search/zoo/returns_one_document.yml +3 -3
- data/spec/cassettes/ElasticAdapter_Index/_search/zoo/returns_the_wanted_document.yml +3 -3
- data/spec/cassettes/ElasticAdapter_Index/_search.yml +111 -0
- data/spec/cassettes/ElasticAdapter_Index/_suggest/query_ba_/returns_bar.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_suggest/query_ba_/returns_one_result.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_suggest.yml +111 -0
- data/spec/cassettes/ElasticAdapter_Index/_validate/invalid_query/is_a_response.yml +4 -3
- data/spec/cassettes/ElasticAdapter_Index/_validate/invalid_query/is_false.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_validate/valid_query/is_a_response.yml +3 -3
- data/spec/cassettes/ElasticAdapter_Index/_validate/valid_query/is_true.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_validate.yml +57 -0
- data/spec/index/count_spec.rb +46 -0
- data/spec/index/create_index_spec.rb +39 -0
- data/spec/index/delete_index_spec.rb +29 -0
- data/spec/index/get_spec.rb +29 -0
- data/spec/index/index_spec.rb +60 -0
- data/spec/index/search_spec.rb +37 -0
- data/spec/index/shared_context.rb +37 -0
- data/spec/index/shared_examples.rb +19 -0
- data/spec/index/suggest_spec.rb +44 -0
- data/spec/index/unit_spec.rb +69 -0
- data/spec/index/validate_spec.rb +55 -0
- data/spec/spec_helper.rb +6 -1
- data/spec/support/index_helper.rb +78 -0
- metadata +72 -7
- 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
|
data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/is_a_Response.yml
CHANGED
@@ -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:
|
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
|
data/spec/cassettes/ElasticAdapter_Index/_get/document_exists/response/contains_the_document.yml
CHANGED
@@ -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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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":"
|
27
|
+
string: '{"_index":"test_index","_type":"test_doc","_id":"AUtlrFrTm1jcpZVj70k1","_version":1,"created":true}'
|
28
28
|
http_version:
|
29
|
-
recorded_at:
|
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:
|
56
|
+
recorded_at: Sat, 07 Feb 2015 20:12:50 GMT
|
57
57
|
recorded_with: VCR 2.9.3
|
data/spec/cassettes/ElasticAdapter_Index/_index/new_document/invokes_to_hash_on_the_document.yml
CHANGED
@@ -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":"
|
27
|
+
string: '{"_index":"test_index","_type":"test_doc","_id":"AUtlrF7cm1jcpZVj70k2","_version":1,"created":true}'
|
28
28
|
http_version:
|
29
|
-
recorded_at:
|
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
|
-
- '
|
24
|
+
- '360'
|
25
25
|
body:
|
26
26
|
encoding: UTF-8
|
27
|
-
string: '{"took":
|
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:
|
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
|
-
- '
|
24
|
+
- '254'
|
25
25
|
body:
|
26
26
|
encoding: UTF-8
|
27
|
-
string: '{"took":
|
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:
|
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
|
-
- '
|
24
|
+
- '254'
|
25
25
|
body:
|
26
26
|
encoding: UTF-8
|
27
|
-
string: '{"took":
|
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:
|
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":"
|
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:
|
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":"
|
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:
|
29
|
+
recorded_at: Sat, 07 Feb 2015 19:44:58 GMT
|
30
30
|
recorded_with: VCR 2.9.3
|