elastic-enterprise-search 7.10.0.beta.1 → 7.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/jobs/elastic+enterprise-search-ruby+7.10.0.beta.1.yml +12 -0
  3. data/.ci/test-matrix.yml +2 -1
  4. data/.github/workflows/testing.yml +1 -1
  5. data/.gitignore +1 -0
  6. data/CONTRIBUTING.md +43 -0
  7. data/Gemfile +1 -0
  8. data/README.md +7 -225
  9. data/Rakefile +1 -24
  10. data/docs/guide/app-search-api.asciidoc +172 -0
  11. data/docs/guide/connecting.asciidoc +125 -0
  12. data/docs/guide/development.asciidoc +42 -0
  13. data/docs/guide/enterprise-search-api.asciidoc +46 -0
  14. data/docs/guide/index.asciidoc +17 -0
  15. data/docs/guide/installation.asciidoc +18 -0
  16. data/docs/guide/overview.asciidoc +59 -0
  17. data/docs/guide/workplace-search-api.asciidoc +121 -0
  18. data/elastic-enterprise-search.gemspec +5 -4
  19. data/lib/elastic/app-search/api/add_meta_engine_source.rb +7 -4
  20. data/lib/elastic/app-search/api/api_logs.rb +15 -16
  21. data/lib/elastic/app-search/api/count_analytics.rb +7 -5
  22. data/lib/elastic/app-search/api/create_curation.rb +8 -6
  23. data/lib/elastic/app-search/api/create_engine.rb +9 -7
  24. data/lib/elastic/app-search/api/create_synonym_set.rb +6 -5
  25. data/lib/elastic/app-search/api/curation.rb +6 -5
  26. data/lib/elastic/app-search/api/delete_curation.rb +6 -5
  27. data/lib/elastic/app-search/api/delete_documents.rb +7 -4
  28. data/lib/elastic/app-search/api/delete_engine.rb +5 -3
  29. data/lib/elastic/app-search/api/delete_meta_engine_source.rb +7 -4
  30. data/lib/elastic/app-search/api/delete_synonym_set.rb +6 -5
  31. data/lib/elastic/app-search/api/documents.rb +7 -4
  32. data/lib/elastic/app-search/api/engine.rb +5 -3
  33. data/lib/elastic/app-search/api/index_documents.rb +7 -4
  34. data/lib/elastic/app-search/api/list_curations.rb +7 -5
  35. data/lib/elastic/app-search/api/list_documents.rb +7 -5
  36. data/lib/elastic/app-search/api/list_engines.rb +7 -5
  37. data/lib/elastic/app-search/api/list_synonym_sets.rb +7 -5
  38. data/lib/elastic/app-search/api/log_clickthrough.rb +10 -7
  39. data/lib/elastic/app-search/api/multi_search.rb +8 -7
  40. data/lib/elastic/app-search/api/put_curation.rb +9 -8
  41. data/lib/elastic/app-search/api/put_documents.rb +7 -4
  42. data/lib/elastic/app-search/api/put_schema.rb +7 -4
  43. data/lib/elastic/app-search/api/put_search_settings.rb +6 -3
  44. data/lib/elastic/app-search/api/put_synonym_set.rb +7 -7
  45. data/lib/elastic/app-search/api/query_suggestion.rb +8 -6
  46. data/lib/elastic/app-search/api/reset_search_settings.rb +5 -3
  47. data/lib/elastic/app-search/api/schema.rb +6 -4
  48. data/lib/elastic/app-search/api/search.rb +5 -3
  49. data/lib/elastic/app-search/api/search_settings.rb +6 -4
  50. data/lib/elastic/app-search/api/synonym_set.rb +6 -5
  51. data/lib/elastic/app-search/api/top_clicks_analytics.rb +9 -7
  52. data/lib/elastic/app-search/api/top_queries_analytics.rb +8 -6
  53. data/lib/elastic/app-search/app_search.rb +19 -2
  54. data/lib/elastic/enterprise-search/api/health.rb +6 -1
  55. data/lib/elastic/enterprise-search/api/put_read_only.rb +5 -1
  56. data/lib/elastic/enterprise-search/api/read_only.rb +6 -1
  57. data/lib/elastic/enterprise-search/api/stats.rb +6 -2
  58. data/lib/elastic/enterprise-search/api/version.rb +6 -1
  59. data/lib/elastic/enterprise-search/client.rb +15 -2
  60. data/lib/elastic/enterprise-search/request.rb +25 -13
  61. data/lib/elastic/enterprise-search/utils.rb +5 -6
  62. data/lib/elastic/enterprise-search/version.rb +1 -1
  63. data/lib/elastic/enterprise_search.rb +1 -1
  64. data/lib/elastic/workplace-search/api/add_user_permissions.rb +10 -9
  65. data/lib/elastic/workplace-search/api/create_analytics_event.rb +59 -0
  66. data/lib/elastic/workplace-search/api/create_external_identity.rb +9 -7
  67. data/lib/elastic/workplace-search/api/delete_documents.rb +9 -7
  68. data/lib/elastic/workplace-search/api/delete_external_identity.rb +10 -6
  69. data/lib/elastic/workplace-search/api/external_identity.rb +10 -6
  70. data/lib/elastic/workplace-search/api/index_documents.rb +11 -8
  71. data/lib/elastic/workplace-search/api/list_external_identities.rb +11 -7
  72. data/lib/elastic/workplace-search/api/list_permissions.rb +11 -7
  73. data/lib/elastic/workplace-search/api/put_external_identity.rb +10 -9
  74. data/lib/elastic/workplace-search/api/put_user_permissions.rb +10 -9
  75. data/lib/elastic/workplace-search/api/remove_user_permissions.rb +10 -9
  76. data/lib/elastic/workplace-search/api/search.rb +19 -1
  77. data/lib/elastic/workplace-search/api/user_permissions.rb +10 -6
  78. data/lib/elastic/workplace-search/workplace_search.rb +26 -1
  79. data/spec/app-search/api_curations_spec.rb +97 -0
  80. data/spec/app-search/api_documents_spec.rb +20 -6
  81. data/spec/app-search/api_engines_spec.rb +4 -4
  82. data/{lib/generator/templates/_license.erb → spec/app-search/api_log_clickthrough_spec.rb} +18 -0
  83. data/spec/app-search/api_meta_engines_spec.rb +72 -0
  84. data/spec/app-search/api_query_suggestion_spec.rb +39 -0
  85. data/spec/app-search/api_schema_spec.rb +17 -3
  86. data/spec/app-search/api_search_settings_spec.rb +76 -0
  87. data/spec/app-search/api_synonyms_spec.rb +79 -0
  88. data/spec/app-search/client_spec.rb +20 -0
  89. data/spec/enterprise-search/client_spec.rb +11 -0
  90. data/spec/enterprise-search/request_spec.rb +22 -0
  91. data/spec/enterprise-search/utils_spec.rb +46 -0
  92. data/spec/fixtures/vcr/app_search/add_meta_engine_source.yml +109 -0
  93. data/spec/fixtures/vcr/app_search/api_documents.yml +56 -0
  94. data/spec/fixtures/vcr/app_search/{index_documents.yml → api_index_documents.yml} +11 -10
  95. data/spec/fixtures/vcr/app_search/api_log_clickthrough.yml +54 -0
  96. data/spec/fixtures/vcr/app_search/api_put_schema.yml +109 -0
  97. data/spec/fixtures/vcr/app_search/api_put_search_settings.yml +56 -0
  98. data/spec/fixtures/vcr/app_search/api_query_suggestion.yml +59 -0
  99. data/spec/fixtures/vcr/app_search/api_reset_search_settings.yml +56 -0
  100. data/spec/fixtures/vcr/app_search/{schema.yml → api_schema.yml} +12 -11
  101. data/spec/fixtures/vcr/app_search/api_search_settings.yml +56 -0
  102. data/spec/fixtures/vcr/app_search/create_curation.yml +113 -0
  103. data/spec/fixtures/vcr/{create_engine.yml → app_search/create_engine.yml} +0 -0
  104. data/spec/fixtures/vcr/app_search/create_meta_engine.yml +56 -0
  105. data/spec/fixtures/vcr/app_search/create_synonym_set.yml +56 -0
  106. data/spec/fixtures/vcr/app_search/delete_curation.yml +56 -0
  107. data/spec/fixtures/vcr/{delete_engine.yml → app_search/delete_engine.yml} +0 -0
  108. data/spec/fixtures/vcr/app_search/delete_meta_engine_source.yml +56 -0
  109. data/spec/fixtures/vcr/app_search/delete_synonym_set.yml +56 -0
  110. data/spec/fixtures/vcr/app_search/get_curation.yml +56 -0
  111. data/spec/fixtures/vcr/{get_engine.yml → app_search/get_engine.yml} +0 -0
  112. data/spec/fixtures/vcr/app_search/list_curations.yml +56 -0
  113. data/spec/fixtures/vcr/{list_engines.yml → app_search/list_engines.yml} +0 -0
  114. data/spec/fixtures/vcr/app_search/list_synonym_sets.yml +56 -0
  115. data/spec/fixtures/vcr/app_search/multi_query_search.yml +2 -2
  116. data/spec/fixtures/vcr/app_search/put_curation.yml +113 -0
  117. data/spec/fixtures/vcr/app_search/put_synonym_set.yml +56 -0
  118. data/spec/fixtures/vcr/app_search/synonym_set.yml +56 -0
  119. data/spec/fixtures/vcr/{add_user_permissions.yml → workplace_search/add_user_permissions.yml} +11 -9
  120. data/spec/fixtures/vcr/{clear_user_permissions.yml → workplace_search/clear_user_permissions.yml} +11 -9
  121. data/spec/fixtures/vcr/workplace_search/create_analytics_event.yml +55 -0
  122. data/spec/fixtures/vcr/workplace_search/create_external_identity.yml +53 -0
  123. data/spec/fixtures/vcr/{delete_documents.yml → workplace_search/delete_documents.yml} +11 -9
  124. data/spec/fixtures/vcr/workplace_search/delete_external_identity.yml +53 -0
  125. data/spec/fixtures/vcr/{index_documents.yml → workplace_search/index_documents.yml} +11 -9
  126. data/spec/fixtures/vcr/workplace_search/list_external_identities.yml +53 -0
  127. data/spec/fixtures/vcr/{list_permissions.yml → workplace_search/list_permissions.yml} +11 -9
  128. data/spec/fixtures/vcr/workplace_search/oauth_request_token.yml +57 -0
  129. data/spec/fixtures/vcr/workplace_search/put_external_identity.yml +53 -0
  130. data/spec/fixtures/vcr/{put_user_permissions.yml → workplace_search/put_user_permissions.yml} +22 -18
  131. data/spec/fixtures/vcr/{remove_user_permissions.yml → workplace_search/remove_user_permissions.yml} +11 -9
  132. data/spec/fixtures/vcr/workplace_search/retrieve_external_identity.yml +53 -0
  133. data/spec/fixtures/vcr/workplace_search/search_request.yml +60 -0
  134. data/spec/fixtures/vcr/{user_permissions_empty.yml → workplace_search/user_permissions_empty.yml} +11 -9
  135. data/spec/integration/enterprise_search_api_spec.rb +2 -2
  136. data/spec/spec_helper.rb +2 -0
  137. data/spec/workplace-search/client_spec.rb +10 -2
  138. data/spec/workplace-search/create_analytics_event_spec.rb +59 -0
  139. data/spec/workplace-search/documents_spec.rb +80 -0
  140. data/spec/workplace-search/external_identities_spec.rb +84 -0
  141. data/spec/workplace-search/{api_spec.rb → permissions_spec.rb} +14 -66
  142. data/spec/workplace-search/search_spec.rb +53 -0
  143. metadata +96 -36
  144. data/lib/generator/documentation_helper.rb +0 -94
  145. data/lib/generator/endpoint_generator.rb +0 -119
  146. data/lib/generator/parameters_exceptions.rb +0 -40
  147. data/lib/generator/parameters_helper.rb +0 -144
  148. data/lib/generator/templates/endpoint_template.erb +0 -29
  149. data/lib/generator/templates/spec_template.erb +0 -1
  150. data/lib/generator/utils.rb +0 -70
  151. data/spec/fixtures/vcr/create_document.yml +0 -54
@@ -25,21 +25,24 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option body - The request body
29
- #
28
+ # @option arguments [Array] :documents List of document to index (*Required*)
29
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
30
30
  #
31
31
  # @see https://www.elastic.co/guide/en/app-search/current/documents.html#documents-create
32
32
  #
33
33
  def index_documents(engine_name, arguments = {})
34
34
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
35
+ raise ArgumentError, "Required parameter 'documents' missing" unless arguments[:documents]
35
36
 
36
- body = arguments.delete(:body) || {}
37
+ documents = arguments.delete(:documents) || {}
38
+ headers = arguments.delete(:headers) || {}
37
39
 
38
40
  request(
39
41
  :post,
40
42
  "api/as/v1/engines/#{engine_name}/documents/",
41
43
  arguments,
42
- body
44
+ documents,
45
+ headers
43
46
  )
44
47
  end
45
48
  end
@@ -25,10 +25,10 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option current_page [String] The page to fetch. Defaults to 1
29
- # @option page_size [String] The number of results per page
30
- # @option body - The request body
31
- #
28
+ # @option arguments [String] :current_page The page to fetch. Defaults to 1
29
+ # @option arguments [String] :page_size The number of results per page
30
+ # @option arguments [Hash] :body The request body
31
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
32
32
  #
33
33
  # @see https://www.elastic.co/guide/en/app-search/current/curations.html#curations-read
34
34
  #
@@ -36,12 +36,14 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
37
37
 
38
38
  body = arguments.delete(:body) || {}
39
+ headers = arguments.delete(:headers) || {}
39
40
 
40
41
  request(
41
42
  :get,
42
43
  "api/as/v1/engines/#{engine_name}/curations/",
43
44
  arguments,
44
- body
45
+ body,
46
+ headers
45
47
  )
46
48
  end
47
49
  end
@@ -25,10 +25,10 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option current_page [String] The page to fetch. Defaults to 1
29
- # @option page_size [String] The number of results per page
30
- # @option body - The request body
31
- #
28
+ # @option arguments [String] :current_page The page to fetch. Defaults to 1
29
+ # @option arguments [String] :page_size The number of results per page
30
+ # @option arguments [Hash] :body The request body
31
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
32
32
  #
33
33
  # @see https://www.elastic.co/guide/en/app-search/current/documents.html#documents-list
34
34
  #
@@ -36,12 +36,14 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
37
37
 
38
38
  body = arguments.delete(:body) || {}
39
+ headers = arguments.delete(:headers) || {}
39
40
 
40
41
  request(
41
42
  :get,
42
43
  "api/as/v1/engines/#{engine_name}/documents/list/",
43
44
  arguments,
44
- body
45
+ body,
46
+ headers
45
47
  )
46
48
  end
47
49
  end
@@ -24,21 +24,23 @@ module Elastic
24
24
  # Engine - Retrieves all engines with optional pagination support
25
25
  #
26
26
  # @param arguments [Hash] endpoint arguments
27
- # @option current_page [String] The page to fetch. Defaults to 1
28
- # @option page_size [String] The number of results per page
29
- # @option body - The request body
30
- #
27
+ # @option arguments [String] :current_page The page to fetch. Defaults to 1
28
+ # @option arguments [String] :page_size The number of results per page
29
+ # @option arguments [Hash] :body The request body
30
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
31
31
  #
32
32
  # @see https://www.elastic.co/guide/en/app-search/current/engines.html#engines-list
33
33
  #
34
34
  def list_engines(arguments = {})
35
35
  body = arguments.delete(:body) || {}
36
+ headers = arguments.delete(:headers) || {}
36
37
 
37
38
  request(
38
39
  :get,
39
40
  'api/as/v1/engines/',
40
41
  arguments,
41
- body
42
+ body,
43
+ headers
42
44
  )
43
45
  end
44
46
  end
@@ -25,10 +25,10 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option current_page [String] The page to fetch. Defaults to 1
29
- # @option page_size [String] The number of results per page
30
- # @option body - The request body
31
- #
28
+ # @option arguments [String] :current_page The page to fetch. Defaults to 1
29
+ # @option arguments [String] :page_size The number of results per page
30
+ # @option arguments [Hash] :body The request body
31
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
32
32
  #
33
33
  # @see https://www.elastic.co/guide/en/app-search/current/synonyms.html#synonyms-get
34
34
  #
@@ -36,12 +36,14 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
37
37
 
38
38
  body = arguments.delete(:body) || {}
39
+ headers = arguments.delete(:headers) || {}
39
40
 
40
41
  request(
41
42
  :get,
42
43
  "api/as/v1/engines/#{engine_name}/synonyms/",
43
44
  arguments,
44
- body
45
+ body,
46
+ headers
45
47
  )
46
48
  end
47
49
  end
@@ -25,12 +25,12 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option query_text [String] Search query text (*Required*)
29
- # @option document_id [] The ID of the document that was clicked on (*Required*)
30
- # @option request_id [String] The request ID returned in the meta tag of a search API response
31
- # @option tags [Array] Array of strings representing additional information you wish to track with the clickthrough
32
- # @option body - The request body
33
- #
28
+ # @option arguments [String] :query_text Search query text (*Required*)
29
+ # @option arguments :document_id The ID of the document that was clicked on (*Required*)
30
+ # @option arguments [String] :request_id The request ID returned in the meta tag of a search API response
31
+ # @option arguments [Array] :tags Array of strings representing additional information you wish to track with the clickthrough
32
+ # @option arguments [Hash] :body The request body
33
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
34
34
  #
35
35
  # @see https://www.elastic.co/guide/en/app-search/current/clickthrough.html
36
36
  #
@@ -40,12 +40,15 @@ module Elastic
40
40
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
41
41
 
42
42
  body = arguments.delete(:body) || {}
43
+ headers = arguments.delete(:headers) || {}
44
+ arguments['query'] = arguments.delete(:query_text)
43
45
 
44
46
  request(
45
47
  :post,
46
48
  "api/as/v1/engines/#{engine_name}/click/",
47
49
  arguments,
48
- body
50
+ body,
51
+ headers
49
52
  )
50
53
  end
51
54
  end
@@ -25,23 +25,24 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option queries [] Search queries (*Required*)
29
- # @option body - The request body
28
+ # @option arguments [Object] :queries One or more queries to execute in parallel (*Required*)
29
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
30
30
  #
31
- #
32
- # @see https://www.elastic.co/guide/en/app-search/current/search.html#search-multi
31
+ # @see https://www.elastic.co/guide/en/app-search/current/multi-search.html
33
32
  #
34
33
  def multi_search(engine_name, arguments = {})
35
- raise ArgumentError, "Required parameter 'queries' missing" unless arguments[:queries]
36
34
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
35
+ raise ArgumentError, "Required parameter 'queries' missing" unless arguments[:queries]
37
36
 
38
- body = arguments.delete(:body) || {}
37
+ queries = arguments.delete(:queries) || {}
38
+ headers = arguments.delete(:headers) || {}
39
39
 
40
40
  request(
41
41
  :post,
42
42
  "api/as/v1/engines/#{engine_name}/multi_search/",
43
43
  arguments,
44
- body
44
+ queries,
45
+ headers
45
46
  )
46
47
  end
47
48
  end
@@ -25,12 +25,12 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option queries [Array] List of affected search queries (*Required*)
29
- # @option curation_id [String] (*Required*)
30
- # @option promoted_doc_ids [] List of promoted document IDs
31
- # @option hidden_doc_ids [] List of hidden document IDs
32
- # @option body - The request body
33
- #
28
+ # @option arguments [Array] :queries List of affected search queries (*Required*)
29
+ # @option arguments [String] :curation_id (*Required*)
30
+ # @option arguments :promoted_doc_ids List of promoted document IDs
31
+ # @option arguments :hidden_doc_ids List of hidden document IDs
32
+ # @option arguments [Hash] :body The request body
33
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
34
34
  #
35
35
  # @see https://www.elastic.co/guide/en/app-search/current/curations.html#curations-update
36
36
  #
@@ -40,14 +40,15 @@ module Elastic
40
40
  raise ArgumentError, "Required parameter 'curation_id' missing" unless arguments[:curation_id]
41
41
 
42
42
  curation_id = arguments[:curation_id]
43
-
44
43
  body = arguments.delete(:body) || {}
44
+ headers = arguments.delete(:headers) || {}
45
45
 
46
46
  request(
47
47
  :put,
48
48
  "api/as/v1/engines/#{engine_name}/curations/#{curation_id}/",
49
49
  arguments,
50
- body
50
+ body,
51
+ headers
51
52
  )
52
53
  end
53
54
  end
@@ -25,21 +25,24 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option body - The request body
29
- #
28
+ # @option arguments [Array] :documents List of documents to update (*Required*)
29
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
30
30
  #
31
31
  # @see https://www.elastic.co/guide/en/app-search/current/documents.html#documents-partial
32
32
  #
33
33
  def put_documents(engine_name, arguments = {})
34
34
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
35
+ raise ArgumentError, "Required parameter 'documents' missing" unless arguments[:documents]
35
36
 
36
- body = arguments.delete(:body) || {}
37
+ documents = arguments.delete(:documents) || {}
38
+ headers = arguments.delete(:headers) || {}
37
39
 
38
40
  request(
39
41
  :patch,
40
42
  "api/as/v1/engines/#{engine_name}/documents/",
41
43
  arguments,
42
- body
44
+ documents,
45
+ headers
43
46
  )
44
47
  end
45
48
  end
@@ -25,21 +25,24 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option body - The request body
29
- #
28
+ # @option arguments [Object] :schema Schema description (*Required*)
29
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
30
30
  #
31
31
  # @see https://www.elastic.co/guide/en/app-search/current/schema.html#schema-patch
32
32
  #
33
33
  def put_schema(engine_name, arguments = {})
34
34
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
35
+ raise ArgumentError, "Required parameter 'schema' missing" unless arguments[:schema]
35
36
 
36
- body = arguments.delete(:body) || {}
37
+ schema = arguments.delete(:schema) || {}
38
+ headers = arguments.delete(:headers) || {}
37
39
 
38
40
  request(
39
41
  :post,
40
42
  "api/as/v1/engines/#{engine_name}/schema/",
41
43
  arguments,
42
- body
44
+ schema,
45
+ headers
43
46
  )
44
47
  end
45
48
  end
@@ -25,21 +25,24 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option body - The request body
29
- #
28
+ # @option arguments [Object] :body Search settings (*Required*)
29
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
30
30
  #
31
31
  # @see https://www.elastic.co/guide/en/app-search/current/search-settings.html#search-settings-update
32
32
  #
33
33
  def put_search_settings(engine_name, arguments = {})
34
34
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
35
+ raise ArgumentError, "Required parameter 'body' missing" unless arguments[:body]
35
36
 
36
37
  body = arguments.delete(:body) || {}
38
+ headers = arguments.delete(:headers) || {}
37
39
 
38
40
  request(
39
41
  :put,
40
42
  "api/as/v1/engines/#{engine_name}/search_settings/",
41
43
  arguments,
42
- body
44
+ body,
45
+ headers
43
46
  )
44
47
  end
45
48
  end
@@ -25,27 +25,27 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option synonyms [] List of synonyms words (*Required*)
29
- # @option synonym_set_id [String] (*Required*)
30
- # @option body - The request body
31
- #
28
+ # @option arguments [String] :synonym_set_id (*Required*)
29
+ # @option arguments [Object] :body Synonym set description (*Required*)
30
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
32
31
  #
33
32
  # @see https://www.elastic.co/guide/en/app-search/current/synonyms.html#synonyms-update
34
33
  #
35
34
  def put_synonym_set(engine_name, arguments = {})
36
- raise ArgumentError, "Required parameter 'synonyms' missing" unless arguments[:synonyms]
37
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
38
36
  raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id]
37
+ raise ArgumentError, "Required parameter 'body' missing" unless arguments[:body]
39
38
 
40
39
  synonym_set_id = arguments[:synonym_set_id]
41
-
42
40
  body = arguments.delete(:body) || {}
41
+ headers = arguments.delete(:headers) || {}
43
42
 
44
43
  request(
45
44
  :put,
46
45
  "api/as/v1/engines/#{engine_name}/synonyms/#{synonym_set_id}/",
47
46
  arguments,
48
- body
47
+ body,
48
+ headers
49
49
  )
50
50
  end
51
51
  end
@@ -25,11 +25,11 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option query [String] A partial query for which to receive suggestions (*Required*)
29
- # @option fields [Array] List of fields to use to generate suggestions. Defaults to all text fields
30
- # @option size [Integer] Number of query suggestions to return. Must be between 1 and 20. Defaults to 5
31
- # @option body - The request body
32
- #
28
+ # @option arguments [String] :query A partial query for which to receive suggestions (*Required*)
29
+ # @option arguments [Array] :fields List of fields to use to generate suggestions. Defaults to all text fields
30
+ # @option arguments [Integer] :size Number of query suggestions to return. Must be between 1 and 20. Defaults to 5
31
+ # @option arguments [Hash] :body The request body
32
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
33
33
  #
34
34
  # @see https://www.elastic.co/guide/en/app-search/current/query-suggestion.html
35
35
  #
@@ -38,12 +38,14 @@ module Elastic
38
38
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
39
39
 
40
40
  body = arguments.delete(:body) || {}
41
+ headers = arguments.delete(:headers) || {}
41
42
 
42
43
  request(
43
44
  :post,
44
45
  "api/as/v1/engines/#{engine_name}/query_suggestion/",
45
46
  arguments,
46
- body
47
+ body,
48
+ headers
47
49
  )
48
50
  end
49
51
  end
@@ -25,8 +25,8 @@ module Elastic
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option body - The request body
29
- #
28
+ # @option arguments [Hash] :body The request body
29
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
30
30
  #
31
31
  # @see https://www.elastic.co/guide/en/app-search/current/search-settings.html#search-settings-reset
32
32
  #
@@ -34,12 +34,14 @@ module Elastic
34
34
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
35
35
 
36
36
  body = arguments.delete(:body) || {}
37
+ headers = arguments.delete(:headers) || {}
37
38
 
38
39
  request(
39
40
  :post,
40
41
  "api/as/v1/engines/#{engine_name}/search_settings/reset/",
41
42
  arguments,
42
- body
43
+ body,
44
+ headers
43
45
  )
44
46
  end
45
47
  end
@@ -21,12 +21,12 @@ module Elastic
21
21
  module EnterpriseSearch
22
22
  module AppSearch
23
23
  module Actions
24
- # Schema - Retrieve current schema for then engine
24
+ # Schema - Retrieve current schema for the engine
25
25
  #
26
26
  # @param engine_name [String] (*Required*)
27
27
  # @param arguments [Hash] endpoint arguments
28
- # @option body - The request body
29
- #
28
+ # @option arguments [Hash] :body The request body
29
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
30
30
  #
31
31
  # @see https://www.elastic.co/guide/en/app-search/current/schema.html#schema-read
32
32
  #
@@ -34,12 +34,14 @@ module Elastic
34
34
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
35
35
 
36
36
  body = arguments.delete(:body) || {}
37
+ headers = arguments.delete(:headers) || {}
37
38
 
38
39
  request(
39
40
  :get,
40
41
  "api/as/v1/engines/#{engine_name}/schema/",
41
42
  arguments,
42
- body
43
+ body,
44
+ headers
43
45
  )
44
46
  end
45
47
  end