elastic-site-search 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +58 -0
  3. data/.gitignore +10 -0
  4. data/.travis.yml +13 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +201 -0
  7. data/NOTICE.txt +3 -0
  8. data/README.md +418 -0
  9. data/Rakefile +1 -0
  10. data/elastic-site-search.gemspec +26 -0
  11. data/lib/data/ca-bundle.crt +3554 -0
  12. data/lib/elastic/site-search.rb +9 -0
  13. data/lib/elastic/site-search/client.rb +527 -0
  14. data/lib/elastic/site-search/configuration.rb +67 -0
  15. data/lib/elastic/site-search/exceptions.rb +11 -0
  16. data/lib/elastic/site-search/ext/backport-uri.rb +33 -0
  17. data/lib/elastic/site-search/request.rb +156 -0
  18. data/lib/elastic/site-search/result_set.rb +84 -0
  19. data/lib/elastic/site-search/sso.rb +22 -0
  20. data/lib/elastic/site-search/version.rb +5 -0
  21. data/logo-site-search.png +0 -0
  22. data/spec/client_spec.rb +728 -0
  23. data/spec/configuration_spec.rb +37 -0
  24. data/spec/fixtures/vcr/analytics_autoselects.yml +57 -0
  25. data/spec/fixtures/vcr/analytics_autoselects_with_document_type.yml +57 -0
  26. data/spec/fixtures/vcr/analytics_autoselects_with_document_type_and_time_range.yml +57 -0
  27. data/spec/fixtures/vcr/analytics_autoselects_with_time_range.yml +57 -0
  28. data/spec/fixtures/vcr/analytics_clicks.yml +57 -0
  29. data/spec/fixtures/vcr/analytics_clicks_with_document_type.yml +57 -0
  30. data/spec/fixtures/vcr/analytics_clicks_with_document_type_and_time_range.yml +57 -0
  31. data/spec/fixtures/vcr/analytics_clicks_with_time_range.yml +57 -0
  32. data/spec/fixtures/vcr/analytics_searches.yml +57 -0
  33. data/spec/fixtures/vcr/analytics_searches_with_document_type_and_time_range.yml +57 -0
  34. data/spec/fixtures/vcr/analytics_searches_with_time_range.yml +57 -0
  35. data/spec/fixtures/vcr/analytics_searchs_with_document_type.yml +57 -0
  36. data/spec/fixtures/vcr/analytics_top_no_result_queries.yml +57 -0
  37. data/spec/fixtures/vcr/analytics_top_no_result_queries_paginated.yml +57 -0
  38. data/spec/fixtures/vcr/analytics_top_queries.yml +57 -0
  39. data/spec/fixtures/vcr/analytics_top_queries_paginated.yml +57 -0
  40. data/spec/fixtures/vcr/analytics_top_queries_too_large.yml +53 -0
  41. data/spec/fixtures/vcr/async_create_or_update_document_failure.yml +48 -0
  42. data/spec/fixtures/vcr/async_create_or_update_document_success.yml +52 -0
  43. data/spec/fixtures/vcr/bulk_create_documents.yml +52 -0
  44. data/spec/fixtures/vcr/bulk_create_or_update_documents_failure.yml +47 -0
  45. data/spec/fixtures/vcr/bulk_create_or_update_documents_success.yml +52 -0
  46. data/spec/fixtures/vcr/bulk_create_or_update_documents_verbose_failure.yml +47 -0
  47. data/spec/fixtures/vcr/bulk_create_or_update_documents_verbose_success.yml +52 -0
  48. data/spec/fixtures/vcr/bulk_destroy_documents.yml +47 -0
  49. data/spec/fixtures/vcr/crawl_url.yml +47 -0
  50. data/spec/fixtures/vcr/create_document.yml +52 -0
  51. data/spec/fixtures/vcr/create_document_type.yml +47 -0
  52. data/spec/fixtures/vcr/create_domain.yml +47 -0
  53. data/spec/fixtures/vcr/create_engine.yml +47 -0
  54. data/spec/fixtures/vcr/create_or_update_document_create.yml +51 -0
  55. data/spec/fixtures/vcr/create_or_update_document_update.yml +51 -0
  56. data/spec/fixtures/vcr/create_user.yml +47 -0
  57. data/spec/fixtures/vcr/destroy_document.yml +43 -0
  58. data/spec/fixtures/vcr/destroy_document_type.yml +43 -0
  59. data/spec/fixtures/vcr/destroy_domain.yml +43 -0
  60. data/spec/fixtures/vcr/destroy_engine.yml +43 -0
  61. data/spec/fixtures/vcr/destroy_non_existent_document_type.yml +45 -0
  62. data/spec/fixtures/vcr/document_receipts_multiple.yml +48 -0
  63. data/spec/fixtures/vcr/document_receipts_multiple_complete.yml +48 -0
  64. data/spec/fixtures/vcr/document_type_search.yml +63 -0
  65. data/spec/fixtures/vcr/document_type_search_pagination.yml +47 -0
  66. data/spec/fixtures/vcr/document_type_suggest.yml +52 -0
  67. data/spec/fixtures/vcr/document_type_suggest_pagination.yml +47 -0
  68. data/spec/fixtures/vcr/engine_search.yml +67 -0
  69. data/spec/fixtures/vcr/engine_search_facets.yml +164 -0
  70. data/spec/fixtures/vcr/engine_search_pagination.yml +47 -0
  71. data/spec/fixtures/vcr/engine_suggest.yml +55 -0
  72. data/spec/fixtures/vcr/engine_suggest_pagination.yml +47 -0
  73. data/spec/fixtures/vcr/find_document.yml +50 -0
  74. data/spec/fixtures/vcr/find_document_type.yml +47 -0
  75. data/spec/fixtures/vcr/find_domain.yml +47 -0
  76. data/spec/fixtures/vcr/find_domain_failure.yml +45 -0
  77. data/spec/fixtures/vcr/find_engine.yml +47 -0
  78. data/spec/fixtures/vcr/list_document_type.yml +47 -0
  79. data/spec/fixtures/vcr/list_documents.yml +71 -0
  80. data/spec/fixtures/vcr/list_documents_with_pagination.yml +71 -0
  81. data/spec/fixtures/vcr/list_domains.yml +47 -0
  82. data/spec/fixtures/vcr/list_engines.yml +48 -0
  83. data/spec/fixtures/vcr/list_users.yml +47 -0
  84. data/spec/fixtures/vcr/list_users_with_pagination.yml +47 -0
  85. data/spec/fixtures/vcr/log_clickthrough_failure.yml +45 -0
  86. data/spec/fixtures/vcr/log_clickthrough_success.yml +47 -0
  87. data/spec/fixtures/vcr/recrawl_domain_failure.yml +46 -0
  88. data/spec/fixtures/vcr/recrawl_domain_success.yml +47 -0
  89. data/spec/fixtures/vcr/show_user.yml +47 -0
  90. data/spec/fixtures/vcr/update_document.yml +50 -0
  91. data/spec/fixtures/vcr/update_document_unknown_field_failure.yml +48 -0
  92. data/spec/fixtures/vcr/update_documents_failure_non_existent_document.yml +47 -0
  93. data/spec/fixtures/vcr/update_documents_success.yml +47 -0
  94. data/spec/fixtures/vcr/users_client_secret_incorrect.yml +44 -0
  95. data/spec/fixtures/vcr/users_no_api_key.yml +44 -0
  96. data/spec/fixtures/vcr/users_no_client_id_or_secret.yml +45 -0
  97. data/spec/platform_spec.rb +95 -0
  98. data/spec/spec_helper.rb +27 -0
  99. data/spec/ssl_spec.rb +34 -0
  100. data/spec/sso_spec.rb +24 -0
  101. metadata +279 -0
@@ -0,0 +1,43 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: http://hello:@localhost:3000/api/v1/engines/crawler-demo-site/domains/52324b132ed960589800004a.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ X-Swiftype-Client:
13
+ - elastic-app-search-ruby
14
+ X-Swiftype-Client-Version:
15
+ - 1.0.0
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 204
21
+ message: No Content
22
+ headers:
23
+ X-Ua-Compatible:
24
+ - IE=Edge
25
+ Cache-Control:
26
+ - no-cache
27
+ Set-Cookie:
28
+ - _session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWMzOTdiNGMxMjUxZmY3ZDNkYjQ3MDM1NTRhYTUyZTRkBjsAVEkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBlU6Gk1vcGVkOjpCU09OOjpPYmplY3RJZCIRUDg5%2By7ZYCnHAAABSSIiJDJhJDEwJE1rNmZOdHA1cC9ZNVIuQU5sZFB2UWUGOwBU--bf52b2401dd088e203b2563c423f090ea98fcb49;
29
+ path=/; HttpOnly
30
+ X-Request-Id:
31
+ - 405af179e6dfd3b14eddf67cd913f14d
32
+ X-Runtime:
33
+ - '0.055119'
34
+ Connection:
35
+ - close
36
+ Server:
37
+ - thin 1.5.0 codename Knife
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ''
41
+ http_version:
42
+ recorded_at: Thu, 12 Sep 2013 23:17:13 GMT
43
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,43 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: http://hello:@localhost:3000/api/v1/engines/new-engine-from-spec.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ X-Swiftype-Client:
13
+ - elastic-app-search-ruby
14
+ X-Swiftype-Client-Version:
15
+ - 1.0.0
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 204
21
+ message: No Content
22
+ headers:
23
+ X-Ua-Compatible:
24
+ - IE=Edge
25
+ Cache-Control:
26
+ - no-cache
27
+ Set-Cookie:
28
+ - _session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTE4OGYyZjY0Nzg1MzBkOWQxNjNiMjViZGNhZjEwNTU0BjsAVEkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBlU6Gk1vcGVkOjpCU09OOjpPYmplY3RJZCIRUDg5%2By7ZYCnHAAABSSIiJDJhJDEwJE1rNmZOdHA1cC9ZNVIuQU5sZFB2UWUGOwBU--db98175a56618c07340907ef4fefb602c5d46b99;
29
+ path=/; HttpOnly
30
+ X-Request-Id:
31
+ - dbb2f1acc3dd9647226d7c17316de7d8
32
+ X-Runtime:
33
+ - '0.052098'
34
+ Connection:
35
+ - close
36
+ Server:
37
+ - thin 1.5.0 codename Knife
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ''
41
+ http_version:
42
+ recorded_at: Thu, 12 Sep 2013 21:30:21 GMT
43
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: http://hello:@localhost:3000/api/v1/engines/site-search-api-example/document_types/not_there.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ""
9
+ headers:
10
+ Accept:
11
+ - ! "*/*"
12
+ X-Swiftype-Client:
13
+ - elastic-app-search-ruby
14
+ X-Swiftype-Client-Version:
15
+ - 1.0.0
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 404
21
+ message: Not Found
22
+ headers:
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ X-Ua-Compatible:
26
+ - IE=Edge
27
+ Cache-Control:
28
+ - no-cache
29
+ Set-Cookie:
30
+ - _session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTdhMDI0OGRhYmRkM2M0ZDJlNDRhMzFiODQ2YTg2MzM3BjsAVEkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBlU6Gk1vcGVkOjpCU09OOjpPYmplY3RJZCIRUDg5%2By7ZYCnHAAABSSIiJDJhJDEwJE1rNmZOdHA1cC9ZNVIuQU5sZFB2UWUGOwBU--7ea19453061a0c033d6be77318d2546897670234;
31
+ path=/; HttpOnly
32
+ X-Request-Id:
33
+ - 3a21cf4a6c541ccc2e02f5ad51b35c15
34
+ X-Runtime:
35
+ - "0.037767"
36
+ Connection:
37
+ - close
38
+ Server:
39
+ - thin 1.5.0 codename Knife
40
+ body:
41
+ encoding: US-ASCII
42
+ string: ! '{"error":"Record not found. No entity with id ''not_there''"}'
43
+ http_version:
44
+ recorded_at: Thu, 12 Sep 2013 21:30:19 GMT
45
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://hello:@localhost:3000/api/v1/document_receipts.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"ids":["54821784cea2601e1b000001","54821784cea2601e1b000003"]}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Swiftype-Ruby/1.1.1
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ X-Ua-Compatible:
26
+ - IE=Edge
27
+ Cache-Control:
28
+ - no-store, must-revalidate, private, max-age=0
29
+ X-Request-Id:
30
+ - 644fe481ad904d735add3f74800ac0a4
31
+ X-Runtime:
32
+ - '0.229593'
33
+ Set-Cookie:
34
+ - __profilin=p%3Dt; path=/
35
+ - __profilin=p%3Dt; path=/
36
+ - __profilin=p%3Dt; path=/
37
+ X-Miniprofiler-Ids:
38
+ - '["o03utgnh6d907hptlew8","czss15qltmk44cy6j9cq","u8yackxsybg5on0cs7i7","vh8t204jhxm6loeah20m","rqy499ku14jw71ohgvss","zp9s6k9zyz1kmcrpu5xy","dvj034r7mg1lpsi3r06f","dp13y57w3blu9jwv9fiw","2ldkuoa3jkcs3pz2dki6","xojyod7vqafw3v4hpbe8"]'
39
+ Connection:
40
+ - close
41
+ Server:
42
+ - thin 1.5.0 codename Knife
43
+ body:
44
+ encoding: UTF-8
45
+ string: '[{"id":"54821784cea2601e1b000001","status":"pending"},{"id":"54821784cea2601e1b000003","status":"pending"}]'
46
+ http_version:
47
+ recorded_at: Fri, 05 Dec 2014 20:37:24 GMT
48
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://hello:@localhost:3000/api/v1/document_receipts.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"ids":["54821784cea2601e1b000001","54821784cea2601e1b000003"]}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Swiftype-Ruby/1.1.1
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ X-Ua-Compatible:
26
+ - IE=Edge
27
+ Cache-Control:
28
+ - no-store, must-revalidate, private, max-age=0
29
+ X-Request-Id:
30
+ - 78b1973f92a6b4fbbf23a8e1c10cebec
31
+ X-Runtime:
32
+ - '0.147900'
33
+ Set-Cookie:
34
+ - __profilin=p%3Dt; path=/
35
+ - __profilin=p%3Dt; path=/
36
+ - __profilin=p%3Dt; path=/
37
+ X-Miniprofiler-Ids:
38
+ - '["qdj3h7dwl6d2met76a0b","wnmyc1ntihxyqrftyh0s","xojyod7vqafw3v4hpbe8","3zi0s45yypdciv34jb3j","if6ym4l6ou4o5u4ntv0e","dui42ogtturqbgny85u2","fcfv77mu922vgmg7nnve","j9661fznrcqg80dka4wg","lxgud0sbzlyd1zu5zuou","xp2t3gwak0solmyqhf08"]'
39
+ Connection:
40
+ - close
41
+ Server:
42
+ - thin 1.5.0 codename Knife
43
+ body:
44
+ encoding: UTF-8
45
+ string: '[{"id":"54821784cea2601e1b000001","status":"complete","link":"http://localhost:3000/api/v1/engines/547e3790cea260a430000005/document_types/547e380fcea26028a900000c/documents/547e3830cea260b9a0000001.json"},{"id":"54821784cea2601e1b000003","status":"complete","link":"http://localhost:3000/api/v1/engines/547e3790cea260a430000005/document_types/547e380fcea26028a900000c/documents/547e3830cea260b9a0000002.json"}]'
46
+ http_version:
47
+ recorded_at: Fri, 05 Dec 2014 20:49:40 GMT
48
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,63 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://hello:@localhost:3000/api/v1/engines/site-search-api-example/document_types/videos/search.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"q":"cat"}'
9
+ headers:
10
+ Accept:
11
+ - ! "*/*"
12
+ X-Swiftype-Client:
13
+ - elastic-app-search-ruby
14
+ X-Swiftype-Client-Version:
15
+ - 1.0.0
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ X-Ua-Compatible:
26
+ - IE=Edge
27
+ Etag:
28
+ - ! '"6c2dbb3f37bd448cfe9a99c0d2efa091"'
29
+ Cache-Control:
30
+ - max-age=0, private, must-revalidate
31
+ Set-Cookie:
32
+ - _session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWQ3MmEzNzU3ZTk3YTc0ZjUxODVkMGQ1ZWJlNGQ5MDMyBjsAVEkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBlU6Gk1vcGVkOjpCU09OOjpPYmplY3RJZCIRUDg5%2By7ZYCnHAAABSSIiJDJhJDEwJE1rNmZOdHA1cC9ZNVIuQU5sZFB2UWUGOwBU--eb803d773ab13fc6f3d33f73954dc4892fc8dc03;
33
+ path=/; HttpOnly
34
+ X-Request-Id:
35
+ - 69889a2a2016d5388428991397b2c5c4
36
+ X-Runtime:
37
+ - "0.082285"
38
+ Connection:
39
+ - close
40
+ Server:
41
+ - thin 1.5.0 codename Knife
42
+ body:
43
+ encoding: US-ASCII
44
+ string:
45
+ ! '{"records":{"videos":[{"external_id":"QH2-TGUlwu4","category_id":"23","caption":"For
46
+ PJ.\n\nCheck out Nyan Cat at http://nyan.cat/\nOfficial Nyan Cat Facebook:
47
+ http://www.facebook.com/NyanCatWorld\nNyan Cat on Twitter: https://twitter.com/nyannyancat\n\nNyan
48
+ Cat Store: http://nyancat.cat/store.html\n\nGIF by PRguitarman http://www.prguitarman.com/index.php?id=348\nSong
49
+ by Daniwell-P/Momone Momo UTAU http://momolabo.lolipop.jp/nyancatsong/Nyan/\n***used
50
+ with permission; I own neither***","channel_id":"UC3VHfy8e1jbDnT5TG2pjP1w","url":"http://www.youtube.com/watch?v=QH2-TGUlwu4","published_at":"2011-04-06T03:21:59Z","thumbnail_url":"https://i.ytimg.com/vi/QH2-TGUlwu4/mqdefault.jpg","title":"Nyan
51
+ Cat [original]","duration":217,"updated_at":"2013-09-12T21:28:13Z","category_name":"Comedy","like_count":711548,"view_count":93258193,"id":"523231ed2ed9605898000028","_score":1.1538672,"_type":"523231e62ed9605898000020","_index":"51b92f982ed960a844000248","_version":null,"sort":null,"highlight":{"title":"Nyan
52
+ <em>Cat</em> [original]","caption":"For PJ.\n\nCheck out Nyan <em>Cat</em>
53
+ at http://nyan.<em>cat</em>/\nOfficial Nyan <em>Cat</em> Facebook: http://www.facebook.com/Nyan<em>Cat</em>World\nNyan
54
+ <em>Cat</em> on Twitter: https://twitter.com/nyannyancat\n\nNyan <em>Cat</em>
55
+ Store: http://nyancat.<em>cat</em>/store.html\n\nGIF by PRguitarman http://www.prguitarman.com/index.php?id=348\nSong
56
+ by Daniwell-P/Momone"},"_explanation":null},{"external_id":"ik5sdwYZ01Q","category_id":"15","caption":"Best
57
+ Harlem Shake Ever. No Ads.","channel_id":"UCiTvufmbsDlYeZ9JOVtiYYQ","url":"http://www.youtube.com/watch?v=ik5sdwYZ01Q","published_at":"2013-02-20T02:37:53Z","thumbnail_url":"https://i.ytimg.com/vi/FHtvDA0W34I/mqdefault.jpg","title":"Grumpy
58
+ Cat Does The Harlem Shake (Ad Free)","duration":18,"updated_at":"2013-09-12T21:28:16Z","category_name":"Pets
59
+ & Animals","like_count":1014,"view_count":125939,"id":"523231f02ed960589800002c","_score":0.86540043,"_type":"523231e62ed9605898000020","_index":"51b92f982ed960a844000248","_version":null,"sort":null,"highlight":{"title":"Grumpy
60
+ <em>Cat</em> Does The Harlem Shake (Ad Free)"},"_explanation":null}]},"info":{"videos":{"query":"cat","current_page":1,"num_pages":1,"per_page":20,"total_result_count":2,"facets":{}}},"errors":{}}'
61
+ http_version:
62
+ recorded_at: Thu, 12 Sep 2013 21:30:20 GMT
63
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,47 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://hello:@localhost:3000/api/v1/engines/site-search-api-example/document_types/videos/search.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"q":"cat","page":2}'
9
+ headers:
10
+ Accept:
11
+ - ! "*/*"
12
+ X-Swiftype-Client:
13
+ - elastic-app-search-ruby
14
+ X-Swiftype-Client-Version:
15
+ - 1.0.0
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ X-Ua-Compatible:
26
+ - IE=Edge
27
+ Etag:
28
+ - ! '"9528fba428e2b9d1022bb008a2c456fe"'
29
+ Cache-Control:
30
+ - max-age=0, private, must-revalidate
31
+ Set-Cookie:
32
+ - _session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTk5ZTIyZTY3NWQ1MWQyNjM4MmYyMTU5YTk0MDJjMGZmBjsAVEkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBlU6Gk1vcGVkOjpCU09OOjpPYmplY3RJZCIRUDg5%2By7ZYCnHAAABSSIiJDJhJDEwJE1rNmZOdHA1cC9ZNVIuQU5sZFB2UWUGOwBU--b78f791deb3c0dc6b7c708eda2acfc66dac2b2ba;
33
+ path=/; HttpOnly
34
+ X-Request-Id:
35
+ - 0dce53b3129013f5973696d8478290c5
36
+ X-Runtime:
37
+ - "0.070520"
38
+ Connection:
39
+ - close
40
+ Server:
41
+ - thin 1.5.0 codename Knife
42
+ body:
43
+ encoding: US-ASCII
44
+ string: ! '{"records":{"videos":[]},"info":{"videos":{"query":"cat","current_page":2,"num_pages":1,"per_page":20,"total_result_count":2,"facets":{}}},"errors":{}}'
45
+ http_version:
46
+ recorded_at: Thu, 12 Sep 2013 21:30:20 GMT
47
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://hello:@localhost:3000/api/v1/engines/site-search-api-example/document_types/videos/suggest.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"q":"goo"}'
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ X-Swiftype-Client:
13
+ - elastic-app-search-ruby
14
+ X-Swiftype-Client-Version:
15
+ - 1.0.0
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ X-Ua-Compatible:
26
+ - IE=Edge
27
+ Etag:
28
+ - ! '"607083a79aa0f63bd8b935c2403590ed"'
29
+ Cache-Control:
30
+ - max-age=0, private, must-revalidate
31
+ Set-Cookie:
32
+ - _session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTVmNDE4MDM5MmZkMGJjYjM1MzIzMDFiODU2ZTY0NmQzBjsAVEkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBlU6Gk1vcGVkOjpCU09OOjpPYmplY3RJZCIRUDg5%2By7ZYCnHAAABSSIiJDJhJDEwJE1rNmZOdHA1cC9ZNVIuQU5sZFB2UWUGOwBU--600df89d2f25ff8398120c82f79483230994a841;
33
+ path=/; HttpOnly
34
+ X-Request-Id:
35
+ - b00e75b9a8ab0709884acc92ff8003a2
36
+ X-Runtime:
37
+ - '0.209337'
38
+ Connection:
39
+ - close
40
+ Server:
41
+ - thin 1.5.0 codename Knife
42
+ body:
43
+ encoding: US-ASCII
44
+ string: ! '{"record_count":1,"records":{"videos":[{"tags":["Glass","Google Glass","Project
45
+ Glass","Glass video","google","glassesgoogle","goggles","if i had glass","Glass
46
+ Explorer","Glass Explorers","glass vid","glass video","ok ..."],"external_id":"v1uyQZNg2vE","category_id":"28","url":"http://www.youtube.com/watch?v=v1uyQZNg2vE","channel_id":"UCK8sQmJBp8GCxrOtXWBpyEA","published_at":"2013-02-20T10:47:18Z","thumbnail_url":"https://i.ytimg.com/vi/v1uyQZNg2vE/mqdefault.jpg","title":"How
47
+ It Feels [through Glass]","duration":136,"updated_at":"2013-09-12T21:28:17Z","category_name":"Science
48
+ &amp; Technology","like_count":75952,"view_count":14599202,"id":"523231f12ed960589800002e","_score":0.6250393,"_type":"523231e62ed9605898000020","_index":"51b92f982ed960a844000248","_version":null,"sort":null,"highlight":{"tags":"<em>Google</em>
49
+ Glass"},"_explanation":null}]},"info":{"videos":{"query":"goo","current_page":1,"num_pages":1,"per_page":10,"total_result_count":1}},"errors":{}}'
50
+ http_version:
51
+ recorded_at: Thu, 12 Sep 2013 21:30:20 GMT
52
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,47 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://hello:@localhost:3000/api/v1/engines/site-search-api-example/document_types/videos/suggest.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"q":"goo","page":2}'
9
+ headers:
10
+ Accept:
11
+ - ! "*/*"
12
+ X-Swiftype-Client:
13
+ - elastic-app-search-ruby
14
+ X-Swiftype-Client-Version:
15
+ - 1.0.0
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ X-Ua-Compatible:
26
+ - IE=Edge
27
+ Etag:
28
+ - ! '"0d6dd112254e507485d54fc519daf383"'
29
+ Cache-Control:
30
+ - max-age=0, private, must-revalidate
31
+ Set-Cookie:
32
+ - _session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTVlMmM1ODE1ZmUwM2ZjNmZlNGVhMGJjNmMwNzRjNDE1BjsAVEkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBlU6Gk1vcGVkOjpCU09OOjpPYmplY3RJZCIRUDg5%2By7ZYCnHAAABSSIiJDJhJDEwJE1rNmZOdHA1cC9ZNVIuQU5sZFB2UWUGOwBU--b61980207cb5f39287c0043c7dc826fdcae252d6;
33
+ path=/; HttpOnly
34
+ X-Request-Id:
35
+ - a5116c1d36bc44ae70dbeb2549174d3c
36
+ X-Runtime:
37
+ - "0.200517"
38
+ Connection:
39
+ - close
40
+ Server:
41
+ - thin 1.5.0 codename Knife
42
+ body:
43
+ encoding: US-ASCII
44
+ string: ! '{"record_count":0,"records":{"videos":[]},"info":{"videos":{"query":"goo","current_page":2,"num_pages":1,"per_page":10,"total_result_count":1}},"errors":{}}'
45
+ http_version:
46
+ recorded_at: Thu, 12 Sep 2013 21:30:20 GMT
47
+ recorded_with: VCR 2.5.0