elastic-enterprise-search 7.16.0 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/jobs/elastic+enterprise-search-ruby+7.13.yml +12 -0
  3. data/.ci/jobs/elastic+enterprise-search-ruby+7.14.yml +12 -0
  4. data/.ci/jobs/elastic+enterprise-search-ruby+7.15.yml +12 -0
  5. data/.ci/jobs/elastic+enterprise-search-ruby+7.16.yml +12 -0
  6. data/.ci/test-matrix.yml +2 -3
  7. data/.github/workflows/testing.yml +3 -3
  8. data/.rubocop.yml +1 -1
  9. data/CHANGELOG +1 -0
  10. data/CODE_OF_CONDUCT +1 -0
  11. data/CONTRIBUTING.md +37 -0
  12. data/NOTICE +2 -0
  13. data/README.md +25 -29
  14. data/docs/guide/app-search-api.asciidoc +39 -31
  15. data/docs/guide/overview.asciidoc +11 -3
  16. data/docs/guide/release_notes/712.asciidoc +10 -0
  17. data/docs/guide/release_notes/714.asciidoc +0 -12
  18. data/docs/guide/release_notes/715.asciidoc +0 -12
  19. data/docs/guide/release_notes/717.asciidoc +9 -0
  20. data/docs/guide/release_notes/80.asciidoc +117 -0
  21. data/docs/guide/release_notes/index.asciidoc +6 -0
  22. data/docs/guide/workplace-search-api.asciidoc +14 -7
  23. data/elastic-enterprise-search.gemspec +3 -3
  24. data/lib/elastic/api/response.rb +52 -0
  25. data/lib/elastic/app-search/api/adaptive_relevance_settings.rb +3 -6
  26. data/lib/elastic/app-search/api/adaptive_relevance_suggestions.rb +10 -6
  27. data/lib/elastic/app-search/api/add_meta_engine_source.rb +4 -5
  28. data/lib/elastic/app-search/api/api_key.rb +4 -6
  29. data/lib/elastic/app-search/api/api_logs.rb +8 -15
  30. data/lib/elastic/app-search/api/count_analytics.rb +5 -5
  31. data/lib/elastic/app-search/api/crawler_active_crawl_request.rb +4 -7
  32. data/lib/elastic/app-search/api/crawler_crawl_request.rb +6 -8
  33. data/lib/elastic/app-search/api/crawler_crawl_schedule.rb +4 -7
  34. data/lib/elastic/app-search/api/crawler_domain.rb +6 -8
  35. data/lib/elastic/app-search/api/crawler_domain_validation_result.rb +5 -4
  36. data/lib/elastic/app-search/api/crawler_metrics.rb +3 -6
  37. data/lib/elastic/app-search/api/crawler_overview.rb +4 -7
  38. data/lib/elastic/app-search/api/crawler_process_crawl.rb +6 -8
  39. data/lib/elastic/app-search/api/crawler_process_crawl_denied_urls.rb +6 -8
  40. data/lib/elastic/app-search/api/crawler_url_extraction_result.rb +6 -6
  41. data/lib/elastic/app-search/api/crawler_url_tracing_result.rb +6 -5
  42. data/lib/elastic/app-search/api/crawler_url_validation_result.rb +6 -5
  43. data/lib/elastic/app-search/api/crawler_user_agent.rb +3 -6
  44. data/lib/elastic/app-search/api/create_api_key.rb +10 -10
  45. data/lib/elastic/app-search/api/create_crawler_crawl_request.rb +9 -5
  46. data/lib/elastic/app-search/api/create_crawler_crawl_rule.rb +13 -12
  47. data/lib/elastic/app-search/api/create_crawler_domain.rb +8 -8
  48. data/lib/elastic/app-search/api/create_crawler_entry_point.rb +10 -9
  49. data/lib/elastic/app-search/api/create_crawler_process_crawl.rb +6 -6
  50. data/lib/elastic/app-search/api/create_crawler_sitemap.rb +10 -9
  51. data/lib/elastic/app-search/api/create_curation.rb +10 -9
  52. data/lib/elastic/app-search/api/create_engine.rb +8 -7
  53. data/lib/elastic/app-search/api/create_synonym_set.rb +6 -6
  54. data/lib/elastic/app-search/api/curation.rb +5 -7
  55. data/lib/elastic/app-search/api/delete_api_key.rb +4 -6
  56. data/lib/elastic/app-search/api/delete_crawler_active_crawl_request.rb +4 -7
  57. data/lib/elastic/app-search/api/delete_crawler_crawl_rule.rb +7 -9
  58. data/lib/elastic/app-search/api/delete_crawler_crawl_schedule.rb +4 -7
  59. data/lib/elastic/app-search/api/delete_crawler_domain.rb +6 -8
  60. data/lib/elastic/app-search/api/delete_crawler_entry_point.rb +7 -9
  61. data/lib/elastic/app-search/api/delete_crawler_sitemap.rb +7 -9
  62. data/lib/elastic/app-search/api/delete_curation.rb +5 -7
  63. data/lib/elastic/app-search/api/delete_documents.rb +4 -5
  64. data/lib/elastic/app-search/api/delete_engine.rb +3 -6
  65. data/lib/elastic/app-search/api/delete_meta_engine_source.rb +4 -4
  66. data/lib/elastic/app-search/api/delete_synonym_set.rb +5 -7
  67. data/lib/elastic/app-search/api/documents.rb +5 -5
  68. data/lib/elastic/app-search/api/engine.rb +3 -6
  69. data/lib/elastic/app-search/api/index_documents.rb +4 -5
  70. data/lib/elastic/app-search/api/list_adaptive_relevance_suggestions.rb +4 -4
  71. data/lib/elastic/app-search/api/list_api_keys.rb +2 -5
  72. data/lib/elastic/app-search/api/list_crawler_crawl_requests.rb +6 -8
  73. data/lib/elastic/app-search/api/list_crawler_domains.rb +6 -7
  74. data/lib/elastic/app-search/api/list_crawler_process_crawls.rb +6 -7
  75. data/lib/elastic/app-search/api/list_curations.rb +3 -6
  76. data/lib/elastic/app-search/api/list_documents.rb +3 -6
  77. data/lib/elastic/app-search/api/list_engines.rb +2 -5
  78. data/lib/elastic/app-search/api/list_synonym_sets.rb +3 -6
  79. data/lib/elastic/app-search/api/log_clickthrough.rb +9 -8
  80. data/lib/elastic/app-search/api/put_adaptive_relevance_settings.rb +6 -5
  81. data/lib/elastic/app-search/api/put_adaptive_relevance_suggestions.rb +4 -4
  82. data/lib/elastic/app-search/api/put_api_key.rb +11 -10
  83. data/lib/elastic/app-search/api/put_crawler_crawl_rule.rb +14 -13
  84. data/lib/elastic/app-search/api/put_crawler_crawl_schedule.rb +8 -7
  85. data/lib/elastic/app-search/api/put_crawler_domain.rb +9 -9
  86. data/lib/elastic/app-search/api/put_crawler_entry_point.rb +11 -10
  87. data/lib/elastic/app-search/api/put_crawler_sitemap.rb +11 -10
  88. data/lib/elastic/app-search/api/put_curation.rb +11 -10
  89. data/lib/elastic/app-search/api/put_documents.rb +4 -4
  90. data/lib/elastic/app-search/api/put_schema.rb +4 -4
  91. data/lib/elastic/app-search/api/put_search_settings.rb +6 -6
  92. data/lib/elastic/app-search/api/put_synonym_set.rb +8 -8
  93. data/lib/elastic/app-search/api/query_suggestion.rb +5 -5
  94. data/lib/elastic/app-search/api/refresh_adaptive_relevance_update_process.rb +56 -0
  95. data/lib/elastic/app-search/api/reset_search_settings.rb +3 -6
  96. data/lib/elastic/app-search/api/schema.rb +3 -6
  97. data/lib/elastic/app-search/api/search.rb +6 -5
  98. data/lib/elastic/app-search/api/search_settings.rb +3 -6
  99. data/lib/elastic/app-search/api/synonym_set.rb +5 -7
  100. data/lib/elastic/app-search/api/top_clicks_analytics.rb +5 -5
  101. data/lib/elastic/app-search/api/top_queries_analytics.rb +4 -4
  102. data/lib/elastic/enterprise-search/api/health.rb +2 -3
  103. data/lib/elastic/enterprise-search/api/put_read_only.rb +6 -4
  104. data/lib/elastic/enterprise-search/api/read_only.rb +2 -3
  105. data/lib/elastic/enterprise-search/api/stats.rb +2 -3
  106. data/lib/elastic/enterprise-search/api/version.rb +2 -3
  107. data/lib/elastic/enterprise-search/client.rb +8 -13
  108. data/lib/elastic/enterprise-search/request.rb +5 -3
  109. data/lib/elastic/enterprise-search/version.rb +1 -1
  110. data/lib/elastic/workplace-search/api/auto_query_refinement_details.rb +3 -4
  111. data/lib/elastic/workplace-search/api/command_sync_jobs.rb +4 -5
  112. data/lib/elastic/workplace-search/api/content_source.rb +3 -4
  113. data/lib/elastic/workplace-search/api/create_analytics_event.rb +16 -12
  114. data/lib/elastic/workplace-search/api/create_batch_synonym_sets.rb +4 -3
  115. data/lib/elastic/workplace-search/api/create_content_source.rb +6 -5
  116. data/lib/elastic/workplace-search/api/create_external_identity.rb +11 -6
  117. data/lib/elastic/workplace-search/api/current_user.rb +3 -5
  118. data/lib/elastic/workplace-search/api/delete_content_source.rb +3 -4
  119. data/lib/elastic/workplace-search/api/delete_documents.rb +4 -4
  120. data/lib/elastic/workplace-search/api/delete_documents_by_query.rb +4 -3
  121. data/lib/elastic/workplace-search/api/delete_external_identity.rb +7 -9
  122. data/lib/elastic/workplace-search/api/delete_synonym_set.rb +3 -5
  123. data/lib/elastic/workplace-search/api/document.rb +4 -6
  124. data/lib/elastic/workplace-search/api/external_identity.rb +7 -9
  125. data/lib/elastic/workplace-search/api/index_documents.rb +3 -4
  126. data/lib/elastic/workplace-search/api/list_content_sources.rb +2 -3
  127. data/lib/elastic/workplace-search/api/list_documents.rb +4 -5
  128. data/lib/elastic/workplace-search/api/list_external_identities.rb +3 -4
  129. data/lib/elastic/workplace-search/api/list_synonym_sets.rb +1 -2
  130. data/lib/elastic/workplace-search/api/put_content_source.rb +6 -6
  131. data/lib/elastic/workplace-search/api/put_content_source_icons.rb +6 -6
  132. data/lib/elastic/workplace-search/api/put_external_identity.rb +11 -10
  133. data/lib/elastic/workplace-search/api/put_synonym_set.rb +4 -4
  134. data/lib/elastic/workplace-search/api/put_triggers_blocklist.rb +3 -5
  135. data/lib/elastic/workplace-search/api/search.rb +13 -13
  136. data/lib/elastic/workplace-search/api/synonym_set.rb +3 -5
  137. data/lib/elastic/workplace-search/api/triggers_blocklist.rb +3 -3
  138. data/spec/app-search/client_spec.rb +29 -0
  139. data/spec/enterprise-search/client_spec.rb +29 -0
  140. data/spec/enterprise-search/request_spec.rb +1 -1
  141. data/spec/integration/app-search/adaptive_relevance_settings_spec.rb +60 -0
  142. data/spec/integration/app-search/adaptive_relevance_suggestions_spec.rb +54 -0
  143. data/spec/integration/app-search/api_logs_spec.rb +11 -3
  144. data/spec/integration/app-search/app_search_helper.rb +2 -2
  145. data/spec/integration/app-search/count_analytics_spec.rb +3 -2
  146. data/spec/integration/app-search/crawler_domain_spec.rb +17 -6
  147. data/spec/integration/app-search/curations_spec.rb +15 -9
  148. data/spec/integration/app-search/engines_spec.rb +24 -26
  149. data/spec/integration/app-search/log_clickthrough_spec.rb +1 -1
  150. data/spec/integration/app-search/meta_engines_spec.rb +5 -5
  151. data/spec/integration/app-search/search_and_multiple_search_spec.rb +1 -1
  152. data/spec/integration/workplace-search/content_sources_spec.rb +6 -6
  153. data/spec/integration/workplace-search/documents_spec.rb +20 -10
  154. data/spec/integration/workplace-search/external_identities_spec.rb +26 -16
  155. data/spec/integration/workplace-search/triggers_spec.rb +2 -2
  156. data/spec/integration/workplace-search/users_spec.rb +0 -6
  157. data/spec/workplace-search/client_spec.rb +29 -0
  158. metadata +24 -21
  159. data/.ci/jobs/elastic+enterprise-search-ruby+7.10.0.beta.1.yml +0 -12
  160. data/.github/compatibility/Gemfile +0 -23
  161. data/.github/workflows/compatibility.yml +0 -20
  162. data/lib/elastic/workplace-search/api/add_user_permissions.rb +0 -54
  163. data/lib/elastic/workplace-search/api/list_permissions.rb +0 -51
  164. data/lib/elastic/workplace-search/api/put_user_permissions.rb +0 -54
  165. data/lib/elastic/workplace-search/api/remove_user_permissions.rb +0 -54
  166. data/lib/elastic/workplace-search/api/user_permissions.rb +0 -53
  167. data/spec/integration/app-search/adaptive_relevance_spec.rb +0 -80
  168. data/spec/integration/workplace-search/permissions_spec.rb +0 -77
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-enterprise-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.16.0
4
+ version: 8.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Briano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-23 00:00:00.000000000 Z
11
+ date: 2022-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: elasticsearch-transport
14
+ name: elastic-transport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '7.11'
19
+ version: 8.0.0.pre.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '7.11'
26
+ version: 8.0.0.pre.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jwt
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +106,14 @@ dependencies:
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: 1.0.0
109
+ version: '1'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: 1.0.0
116
+ version: '1'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: vcr
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -164,7 +164,10 @@ files:
164
164
  - ".ci/functions/imports.sh"
165
165
  - ".ci/functions/wait-for-container.sh"
166
166
  - ".ci/jobs/defaults.yml"
167
- - ".ci/jobs/elastic+enterprise-search-ruby+7.10.0.beta.1.yml"
167
+ - ".ci/jobs/elastic+enterprise-search-ruby+7.13.yml"
168
+ - ".ci/jobs/elastic+enterprise-search-ruby+7.14.yml"
169
+ - ".ci/jobs/elastic+enterprise-search-ruby+7.15.yml"
170
+ - ".ci/jobs/elastic+enterprise-search-ruby+7.16.yml"
168
171
  - ".ci/jobs/elastic+enterprise-search-ruby+main.yml"
169
172
  - ".ci/jobs/elastic+enterprise-search-ruby+pull-request.yml"
170
173
  - ".ci/make.sh"
@@ -175,17 +178,18 @@ files:
175
178
  - ".ci/run-tests"
176
179
  - ".ci/test-matrix.yml"
177
180
  - ".github/check_license_headers.rb"
178
- - ".github/compatibility/Gemfile"
179
181
  - ".github/license-header.txt"
180
- - ".github/workflows/compatibility.yml"
181
182
  - ".github/workflows/license.yml"
182
183
  - ".github/workflows/rubocop.yml"
183
184
  - ".github/workflows/testing.yml"
184
185
  - ".gitignore"
185
186
  - ".rubocop.yml"
187
+ - CHANGELOG
188
+ - CODE_OF_CONDUCT
186
189
  - CONTRIBUTING.md
187
190
  - Gemfile
188
191
  - LICENSE
192
+ - NOTICE
189
193
  - README.md
190
194
  - Rakefile
191
195
  - docs/guide/app-search-api.asciidoc
@@ -202,12 +206,15 @@ files:
202
206
  - docs/guide/release_notes/714.asciidoc
203
207
  - docs/guide/release_notes/715.asciidoc
204
208
  - docs/guide/release_notes/716.asciidoc
209
+ - docs/guide/release_notes/717.asciidoc
210
+ - docs/guide/release_notes/80.asciidoc
205
211
  - docs/guide/release_notes/index.asciidoc
206
212
  - docs/guide/workplace-search-api.asciidoc
207
213
  - elastic-enterprise-search.gemspec
208
214
  - lib/data/ca-bundle.crt
209
215
  - lib/elastic-enterprise-search.rb
210
216
  - lib/elastic/.rubocop.yml
217
+ - lib/elastic/api/response.rb
211
218
  - lib/elastic/app-search/api/adaptive_relevance_settings.rb
212
219
  - lib/elastic/app-search/api/adaptive_relevance_suggestions.rb
213
220
  - lib/elastic/app-search/api/add_meta_engine_source.rb
@@ -280,6 +287,7 @@ files:
280
287
  - lib/elastic/app-search/api/put_search_settings.rb
281
288
  - lib/elastic/app-search/api/put_synonym_set.rb
282
289
  - lib/elastic/app-search/api/query_suggestion.rb
290
+ - lib/elastic/app-search/api/refresh_adaptive_relevance_update_process.rb
283
291
  - lib/elastic/app-search/api/reset_search_settings.rb
284
292
  - lib/elastic/app-search/api/schema.rb
285
293
  - lib/elastic/app-search/api/search.rb
@@ -300,7 +308,6 @@ files:
300
308
  - lib/elastic/enterprise-search/utils.rb
301
309
  - lib/elastic/enterprise-search/version.rb
302
310
  - lib/elastic/enterprise_search.rb
303
- - lib/elastic/workplace-search/api/add_user_permissions.rb
304
311
  - lib/elastic/workplace-search/api/auto_query_refinement_details.rb
305
312
  - lib/elastic/workplace-search/api/command_sync_jobs.rb
306
313
  - lib/elastic/workplace-search/api/content_source.rb
@@ -321,19 +328,15 @@ files:
321
328
  - lib/elastic/workplace-search/api/list_content_sources.rb
322
329
  - lib/elastic/workplace-search/api/list_documents.rb
323
330
  - lib/elastic/workplace-search/api/list_external_identities.rb
324
- - lib/elastic/workplace-search/api/list_permissions.rb
325
331
  - lib/elastic/workplace-search/api/list_synonym_sets.rb
326
332
  - lib/elastic/workplace-search/api/put_content_source.rb
327
333
  - lib/elastic/workplace-search/api/put_content_source_icons.rb
328
334
  - lib/elastic/workplace-search/api/put_external_identity.rb
329
335
  - lib/elastic/workplace-search/api/put_synonym_set.rb
330
336
  - lib/elastic/workplace-search/api/put_triggers_blocklist.rb
331
- - lib/elastic/workplace-search/api/put_user_permissions.rb
332
- - lib/elastic/workplace-search/api/remove_user_permissions.rb
333
337
  - lib/elastic/workplace-search/api/search.rb
334
338
  - lib/elastic/workplace-search/api/synonym_set.rb
335
339
  - lib/elastic/workplace-search/api/triggers_blocklist.rb
336
- - lib/elastic/workplace-search/api/user_permissions.rb
337
340
  - lib/elastic/workplace-search/workplace_search.rb
338
341
  - rake_tasks/unified_release_tasks.rake
339
342
  - spec/app-search/client_spec.rb
@@ -344,7 +347,8 @@ files:
344
347
  - spec/fixtures/vcr/workplace_search/create_analytics_event.yml
345
348
  - spec/fixtures/vcr/workplace_search/oauth_request_token.yml
346
349
  - spec/fixtures/vcr/workplace_search/search_request.yml
347
- - spec/integration/app-search/adaptive_relevance_spec.rb
350
+ - spec/integration/app-search/adaptive_relevance_settings_spec.rb
351
+ - spec/integration/app-search/adaptive_relevance_suggestions_spec.rb
348
352
  - spec/integration/app-search/api_key_spec.rb
349
353
  - spec/integration/app-search/api_logs_spec.rb
350
354
  - spec/integration/app-search/app_search_helper.rb
@@ -378,7 +382,6 @@ files:
378
382
  - spec/integration/workplace-search/documents_spec.rb
379
383
  - spec/integration/workplace-search/external_identities_spec.rb
380
384
  - spec/integration/workplace-search/icon.png
381
- - spec/integration/workplace-search/permissions_spec.rb
382
385
  - spec/integration/workplace-search/synonym_sets_spec.rb
383
386
  - spec/integration/workplace-search/triggers_spec.rb
384
387
  - spec/integration/workplace-search/users_spec.rb
@@ -405,14 +408,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
405
408
  requirements:
406
409
  - - ">="
407
410
  - !ruby/object:Gem::Version
408
- version: '2.5'
411
+ version: '2.6'
409
412
  required_rubygems_version: !ruby/object:Gem::Requirement
410
413
  requirements:
411
414
  - - ">="
412
415
  - !ruby/object:Gem::Version
413
416
  version: '0'
414
417
  requirements: []
415
- rubygems_version: 3.2.22
418
+ rubygems_version: 3.3.3
416
419
  signing_key:
417
420
  specification_version: 4
418
421
  summary: Official API client for Elastic Enterprise Search
@@ -1,12 +0,0 @@
1
- ---
2
- - job:
3
- name: elastic+enterprise-search-ruby+7.10.0.beta.1
4
- display-name: 'elastic / enterprise-search-ruby # 7.10.0.beta.1'
5
- description: Testing the enterprise-search-ruby 7.10.0.beta.1 branch.
6
- junit_results: "*-junit.xml"
7
- parameters:
8
- - string:
9
- name: branch_specifier
10
- default: refs/heads/7.10.0.beta.1
11
- description: the Git branch specifier to build (<branchName>, <tagName>,
12
- <commitId>, etc.)
@@ -1,23 +0,0 @@
1
- # Licensed to Elasticsearch B.V. under one or more contributor
2
- # license agreements. See the NOTICE file distributed with
3
- # this work for additional information regarding copyright
4
- # ownership. Elasticsearch B.V. licenses this file to you under
5
- # the Apache License, Version 2.0 (the "License"); you may
6
- # not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing,
12
- # software distributed under the License is distributed on an
13
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- # KIND, either express or implied. See the License for the
15
- # specific language governing permissions and limitations
16
- # under the License.
17
-
18
- # frozen_string_literal: true
19
-
20
- source 'https://rubygems.org'
21
-
22
- gem 'elasticsearch', ENV['es-version']
23
- gem 'elastic-enterprise-search', path: File.expand_path('../../', __dir__)
@@ -1,20 +0,0 @@
1
- name: Compatibility with Elasticsearch
2
- on: [push, pull_request]
3
-
4
- jobs:
5
- elasticsearch:
6
- env:
7
- ES_VERSION: ${{ matrix.es_version }}
8
- strategy:
9
- matrix:
10
- es_version: [ 7.11, 7.12, 7.13, 7.14, 7.15 ]
11
- runs-on: ubuntu-latest
12
- steps:
13
- - uses: actions/checkout@v2
14
- - uses: ruby/setup-ruby@v1
15
- with:
16
- ruby-version: 3.0
17
- - name: Build Gemfile with Elasticsearch gem
18
- run: |
19
- ruby -v
20
- cd ./.github/compatibility/ && bundle
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed to Elasticsearch B.V. under one or more contributor
4
- # license agreements. See the NOTICE file distributed with
5
- # this work for additional information regarding copyright
6
- # ownership. Elasticsearch B.V. licenses this file to you under
7
- # the Apache License, Version 2.0 (the "License"); you may
8
- # not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing,
14
- # software distributed under the License is distributed on an
15
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- # KIND, either express or implied. See the License for the
17
- # specific language governing permissions and limitations
18
- # under the License.
19
-
20
- module Elastic
21
- module EnterpriseSearch
22
- module WorkplaceSearch
23
- module Actions
24
- # Permissions - Adds one or more new permissions atop existing permissions
25
- # Add one or more permission for a given user. Permissions are added atop the existing
26
- #
27
- # @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
28
- # @param arguments [Hash] endpoint arguments
29
- # @option arguments [String] :user The username in context (*Required*)
30
- # @option arguments [Array] :body List of permissions
31
- # @option arguments [Hash] :headers optional HTTP headers to send with the request
32
- #
33
- # @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-document-permissions-api.html#add-one
34
- #
35
- def add_user_permissions(content_source_id, arguments = {})
36
- raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
37
- raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user]
38
-
39
- user = arguments[:user]
40
- body = arguments.delete(:body) || {}
41
- headers = arguments.delete(:headers) || {}
42
-
43
- request(
44
- :post,
45
- "api/ws/v1/sources/#{content_source_id}/permissions/#{user}/add/",
46
- arguments,
47
- body,
48
- headers
49
- )
50
- end
51
- end
52
- end
53
- end
54
- end
@@ -1,51 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed to Elasticsearch B.V. under one or more contributor
4
- # license agreements. See the NOTICE file distributed with
5
- # this work for additional information regarding copyright
6
- # ownership. Elasticsearch B.V. licenses this file to you under
7
- # the Apache License, Version 2.0 (the "License"); you may
8
- # not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing,
14
- # software distributed under the License is distributed on an
15
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- # KIND, either express or implied. See the License for the
17
- # specific language governing permissions and limitations
18
- # under the License.
19
-
20
- module Elastic
21
- module EnterpriseSearch
22
- module WorkplaceSearch
23
- module Actions
24
- # Permissions - Lists all permissions for all users
25
- # List all permissions for all users
26
- #
27
- # @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
28
- # @param arguments [Hash] endpoint arguments
29
- # @option arguments [Integer] :current_page Which page of results to request
30
- # @option arguments [Integer] :page_size The number of results to return in a page
31
- # @option arguments [Hash] :headers optional HTTP headers to send with the request
32
- #
33
- # @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-document-permissions-api.html#list
34
- #
35
- def list_permissions(content_source_id, arguments = {})
36
- raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
37
-
38
- headers = arguments.delete(:headers) || {}
39
-
40
- request(
41
- :get,
42
- "api/ws/v1/sources/#{content_source_id}/permissions/",
43
- arguments,
44
- {},
45
- headers
46
- )
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed to Elasticsearch B.V. under one or more contributor
4
- # license agreements. See the NOTICE file distributed with
5
- # this work for additional information regarding copyright
6
- # ownership. Elasticsearch B.V. licenses this file to you under
7
- # the Apache License, Version 2.0 (the "License"); you may
8
- # not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing,
14
- # software distributed under the License is distributed on an
15
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- # KIND, either express or implied. See the License for the
17
- # specific language governing permissions and limitations
18
- # under the License.
19
-
20
- module Elastic
21
- module EnterpriseSearch
22
- module WorkplaceSearch
23
- module Actions
24
- # Permissions - Creates a new set of permissions or over-writes all existing permissions
25
- # Create a set of permissions or overwrite existing permissions
26
- #
27
- # @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
28
- # @param arguments [Hash] endpoint arguments
29
- # @option arguments [String] :user The username in context (*Required*)
30
- # @option arguments [Array] :body List of permissions
31
- # @option arguments [Hash] :headers optional HTTP headers to send with the request
32
- #
33
- # @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-document-permissions-api.html#add-all
34
- #
35
- def put_user_permissions(content_source_id, arguments = {})
36
- raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
37
- raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user]
38
-
39
- user = arguments[:user]
40
- body = arguments.delete(:body) || {}
41
- headers = arguments.delete(:headers) || {}
42
-
43
- request(
44
- :put,
45
- "api/ws/v1/sources/#{content_source_id}/permissions/#{user}/",
46
- arguments,
47
- body,
48
- headers
49
- )
50
- end
51
- end
52
- end
53
- end
54
- end
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed to Elasticsearch B.V. under one or more contributor
4
- # license agreements. See the NOTICE file distributed with
5
- # this work for additional information regarding copyright
6
- # ownership. Elasticsearch B.V. licenses this file to you under
7
- # the Apache License, Version 2.0 (the "License"); you may
8
- # not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing,
14
- # software distributed under the License is distributed on an
15
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- # KIND, either express or implied. See the License for the
17
- # specific language governing permissions and limitations
18
- # under the License.
19
-
20
- module Elastic
21
- module EnterpriseSearch
22
- module WorkplaceSearch
23
- module Actions
24
- # Permissions - Removes one or more permissions from an existing set of permissions
25
- # Remove one or more permission for a given user
26
- #
27
- # @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
28
- # @param arguments [Hash] endpoint arguments
29
- # @option arguments [String] :user The username in context (*Required*)
30
- # @option arguments [Array] :body List of permissions
31
- # @option arguments [Hash] :headers optional HTTP headers to send with the request
32
- #
33
- # @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-document-permissions-api.html#remove-one
34
- #
35
- def remove_user_permissions(content_source_id, arguments = {})
36
- raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
37
- raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user]
38
-
39
- user = arguments[:user]
40
- body = arguments.delete(:body) || {}
41
- headers = arguments.delete(:headers) || {}
42
-
43
- request(
44
- :post,
45
- "api/ws/v1/sources/#{content_source_id}/permissions/#{user}/remove/",
46
- arguments,
47
- body,
48
- headers
49
- )
50
- end
51
- end
52
- end
53
- end
54
- end
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed to Elasticsearch B.V. under one or more contributor
4
- # license agreements. See the NOTICE file distributed with
5
- # this work for additional information regarding copyright
6
- # ownership. Elasticsearch B.V. licenses this file to you under
7
- # the Apache License, Version 2.0 (the "License"); you may
8
- # not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing,
14
- # software distributed under the License is distributed on an
15
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- # KIND, either express or implied. See the License for the
17
- # specific language governing permissions and limitations
18
- # under the License.
19
-
20
- module Elastic
21
- module EnterpriseSearch
22
- module WorkplaceSearch
23
- module Actions
24
- # Permissions - Lists all permissions for one user
25
- # List permissions for a user
26
- #
27
- # @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
28
- # @param arguments [Hash] endpoint arguments
29
- # @option arguments [String] :user The username in context (*Required*)
30
- # @option arguments [Hash] :headers optional HTTP headers to send with the request
31
- #
32
- # @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-document-permissions-api.html#list-one
33
- #
34
- def user_permissions(content_source_id, arguments = {})
35
- raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
36
- raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user]
37
-
38
- user = arguments[:user]
39
-
40
- headers = arguments.delete(:headers) || {}
41
-
42
- request(
43
- :get,
44
- "api/ws/v1/sources/#{content_source_id}/permissions/#{user}/",
45
- arguments,
46
- {},
47
- headers
48
- )
49
- end
50
- end
51
- end
52
- end
53
- end
@@ -1,80 +0,0 @@
1
- # Licensed to Elasticsearch B.V. under one or more contributor
2
- # license agreements. See the NOTICE file distributed with
3
- # this work for additional information regarding copyright
4
- # ownership. Elasticsearch B.V. licenses this file to you under
5
- # the Apache License, Version 2.0 (the "License"); you may
6
- # not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing,
12
- # software distributed under the License is distributed on an
13
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- # KIND, either express or implied. See the License for the
15
- # specific language governing permissions and limitations
16
- # under the License.
17
-
18
- # frozen_string_literal: true
19
-
20
- require_relative "#{__dir__}/app_search_helper.rb"
21
-
22
- describe Elastic::EnterpriseSearch::AppSearch::Client do
23
- context 'Adaptive Relevance' do
24
- let(:engine_name) { 'adaptive-relevance' }
25
-
26
- before do
27
- create_engine(engine_name)
28
- end
29
-
30
- after do
31
- delete_engines
32
- end
33
-
34
- it 'retrieves adaptive relevance settings' do
35
- response = client.adaptive_relevance_settings(engine_name)
36
- expect(response.body['curation'])
37
- expect(response.status).to eq 200
38
- end
39
-
40
- it 'updates settings and lists adaptive relevance for an engine' do
41
- body = { curation: { enabled: true } }
42
- # Enables curations
43
- response = client.put_adaptive_relevance_settings(engine_name, body: body)
44
- expect(response.status).to eq 200
45
- expect(response.body.dig('curation', 'enabled'))
46
-
47
- # Lists suggestions
48
- response = client.list_adaptive_relevance_suggestions(engine_name)
49
- expect(response.status).to eq 200
50
- expect(response.body['meta'])
51
- expect(response.body['results'])
52
- end
53
-
54
- xit 'updates adaptive relevance' do
55
- body = { curation: { enabled: true } }
56
- client.put_adaptive_relevance_settings(engine_name, body: body)
57
-
58
- # Index document and create curation:
59
- id = client.index_documents(engine_name, documents: [{ title: 'experiment' }]).body.first['id']
60
- body = { queries: ['test'], promoted: [id] }
61
- client.create_curation(engine_name, body: body)
62
- body = [{ query: 'test', type: 'curation', status: 'applied' }]
63
- response = client.put_adaptive_relevance_suggestions(engine_name, body: body)
64
-
65
- expect(response.status).to eq 200
66
- end
67
-
68
- xit 'retrieves an adaptive relevance' do
69
- # Enables curations
70
- client.put_adaptive_relevance_settings(engine_name, body: { curation: { enabled: true } })
71
- id = client.index_documents(engine_name, documents: [{ title: 'experiment' }]).body.first['id']
72
- body = { queries: ['test'], promoted: [id] }
73
- client.create_curation(engine_name, body: body)
74
-
75
- response = client.adaptive_relevance_suggestions(engine_name, search_suggestion_query: 'test')
76
- expect(response.status).to eq 200
77
- expect(response.body)
78
- end
79
- end
80
- end
@@ -1,77 +0,0 @@
1
- # Licensed to Elasticsearch B.V. under one or more contributor
2
- # license agreements. See the NOTICE file distributed with
3
- # this work for additional information regarding copyright
4
- # ownership. Elasticsearch B.V. licenses this file to you under
5
- # the Apache License, Version 2.0 (the "License"); you may
6
- # not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing,
12
- # software distributed under the License is distributed on an
13
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- # KIND, either express or implied. See the License for the
15
- # specific language governing permissions and limitations
16
- # under the License.
17
-
18
- # frozen_string_literal: true
19
-
20
- require_relative "#{__dir__}/workplace_search_helper.rb"
21
-
22
- describe Elastic::EnterpriseSearch::WorkplaceSearch::Client do
23
- context 'Permissions' do
24
- let(:content_source_id) { client.create_content_source(name: 'my_content').body['id'] }
25
- let(:user) { 'enterprise_search' }
26
- let(:permissions) { ['permission1', 'permission2'] }
27
-
28
- after do
29
- client.put_user_permissions(content_source_id, { permissions: [], user: user })
30
- delete_content_sources
31
- end
32
-
33
- it 'adds permissions to a user' do
34
- response = client.add_user_permissions(
35
- content_source_id,
36
- { permissions: permissions, user: user }
37
- )
38
- expect(response.status).to eq 200
39
- expect(response.body).to eq({ 'user' => 'enterprise_search', 'permissions' => ['permission1', 'permission2'] })
40
- end
41
-
42
- it 'removes permissions from a user' do
43
- client.add_user_permissions(content_source_id, { permissions: permissions, user: user })
44
-
45
- # Removes Permissions
46
- response = client.remove_user_permissions(
47
- content_source_id,
48
- { permissions: permissions, user: user }
49
- )
50
- expect(response.status).to eq 200
51
- expect(response.body).to eq({ 'user' => 'enterprise_search', 'permissions' => [] })
52
- end
53
-
54
- it 'lists permissions' do
55
- response = client.list_permissions(content_source_id)
56
- expect(response.status).to eq 200
57
- end
58
-
59
- it 'gets a user\'s permissions' do
60
- client.add_user_permissions(content_source_id, { permissions: permissions, user: user })
61
- response = client.user_permissions(content_source_id, { user: user })
62
- expect(response.status).to eq 200
63
- expect(response.body).to eq({ 'user' => 'enterprise_search', 'permissions' => permissions })
64
- end
65
-
66
- it 'updates a user\'s permissions' do
67
- permissions = ['testing', 'more', 'permissions']
68
- response = client.add_user_permissions(content_source_id, { permissions: permissions, user: user })
69
- expect(response.status).to eq 200
70
- expect(response.body).to eq({ 'user' => 'enterprise_search', 'permissions' => permissions })
71
-
72
- response = client.put_user_permissions(content_source_id, { permissions: [], user: user })
73
- expect(response.status).to eq 200
74
- expect(response.body).to eq({ 'user' => 'enterprise_search', 'permissions' => [] })
75
- end
76
- end
77
- end