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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3331736a101d1b938e0911742b67fe42a42849e179e8f5b575f9f2b07dafda2
4
- data.tar.gz: 3ef839006353cd13259ec36ddf0244c2c6812f19add3a04b48dd169e2d66238c
3
+ metadata.gz: fe3de694901dc1b16bef977ae8e1c5fbe17da770daa14cf59fbbe3c46588331a
4
+ data.tar.gz: ca7d3672c8d91810d5ae0589f444ebc3992b7cb4673729b7c45e1e3184a43555
5
5
  SHA512:
6
- metadata.gz: 5f1d529bdbd13f0c550bee3f475ee799ec537e39ffc172b18119a194fe61c27a8452c56e1cd1ee8cb68a6d60fb56da92bc4cadad82d35650119df7ef21647e09
7
- data.tar.gz: 36465dbde68f27f1d39a7afb829e890e6ccda5c6b4fce70186ecc229ada201de89a13fbbd198d2c6a5b483ac4e4e5c28abd516633d5a45c7b241bc2ecc92d6ff
6
+ metadata.gz: 580b81ecdca1b5e7522b3a5b54e237b29bccad3d99b93af9161c0f54196e4960436208b463f7dd6b416faef68e048c4c1b7bb4efe1429fcf7601184b0df35384
7
+ data.tar.gz: 05d5729c7254f93b0ca8b77a4400195b72854bf9973c2a499b23b90b2ecae8c20d82dc97fa68f2a05a7947305deab8d0578b92fc89b224a8c23395fdedfb0388
@@ -0,0 +1,12 @@
1
+ ---
2
+ - job:
3
+ name: elastic+enterprise-search-ruby+7.13
4
+ display-name: 'elastic / enterprise-search-ruby # 7.13'
5
+ description: Testing the enterprise-search-ruby 7.13 branch.
6
+ junit_results: "*-junit.xml"
7
+ parameters:
8
+ - string:
9
+ name: branch_specifier
10
+ default: refs/heads/7.13
11
+ description: the Git branch specifier to build (<branchName>, <tagName>,
12
+ <commitId>, etc.)
@@ -0,0 +1,12 @@
1
+ ---
2
+ - job:
3
+ name: elastic+enterprise-search-ruby+7.14
4
+ display-name: 'elastic / enterprise-search-ruby # 7.14'
5
+ description: Testing the enterprise-search-ruby 7.14 branch.
6
+ junit_results: "*-junit.xml"
7
+ parameters:
8
+ - string:
9
+ name: branch_specifier
10
+ default: refs/heads/7.14
11
+ description: the Git branch specifier to build (<branchName>, <tagName>,
12
+ <commitId>, etc.)
@@ -0,0 +1,12 @@
1
+ ---
2
+ - job:
3
+ name: elastic+enterprise-search-ruby+7.15
4
+ display-name: 'elastic / enterprise-search-ruby # 7.15'
5
+ description: Testing the enterprise-search-ruby 7.15 branch.
6
+ junit_results: "*-junit.xml"
7
+ parameters:
8
+ - string:
9
+ name: branch_specifier
10
+ default: refs/heads/7.15
11
+ description: the Git branch specifier to build (<branchName>, <tagName>,
12
+ <commitId>, etc.)
@@ -0,0 +1,12 @@
1
+ ---
2
+ - job:
3
+ name: elastic+enterprise-search-ruby+7.16
4
+ display-name: 'elastic / enterprise-search-ruby # 7.16'
5
+ description: Testing the enterprise-search-ruby 7.16 branch.
6
+ junit_results: "*-junit.xml"
7
+ parameters:
8
+ - string:
9
+ name: branch_specifier
10
+ default: refs/heads/7.16
11
+ description: the Git branch specifier to build (<branchName>, <tagName>,
12
+ <commitId>, etc.)
data/.ci/test-matrix.yml CHANGED
@@ -1,12 +1,11 @@
1
1
  ---
2
2
  RUBY_VERSION:
3
+ - 3.1
3
4
  - 3.0
4
5
  - 2.7
5
- - 2.6
6
- - 2.5
7
6
 
8
7
  STACK_VERSION:
9
- - 7.16-SNAPSHOT
8
+ - 8.0-SNAPSHOT
10
9
 
11
10
  SERVICE:
12
11
  - appsearch
@@ -1,4 +1,4 @@
1
- name: 7.x
1
+ name: main
2
2
  on: [push, pull_request]
3
3
 
4
4
  jobs:
@@ -7,7 +7,7 @@ jobs:
7
7
  ENDPOINT: http://localhost:8080
8
8
  strategy:
9
9
  matrix:
10
- ruby: [ 2.5, 2.6, 2.7, 3.0 ]
10
+ ruby: [ 2.7, 3.0, 3.1 ]
11
11
 
12
12
  runs-on: ubuntu-latest
13
13
  steps:
@@ -26,7 +26,7 @@ jobs:
26
26
  strategy:
27
27
  fail-fast: false
28
28
  matrix:
29
- ruby: [ jruby-9.2 ]
29
+ ruby: [ jruby-9.3 ]
30
30
  runs-on: ubuntu-latest
31
31
  steps:
32
32
  - uses: actions/checkout@v2
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.5
2
+ TargetRubyVersion: 2.6
3
3
  Layout/EndAlignment:
4
4
  AutoCorrect: true
5
5
  Style/StringLiterals:
data/CHANGELOG ADDED
@@ -0,0 +1 @@
1
+ See https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/release_notes.html
data/CODE_OF_CONDUCT ADDED
@@ -0,0 +1 @@
1
+ See: https://www.elastic.co/community/codeofconduct
data/CONTRIBUTING.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Contributing to enterprise-search-ruby
2
2
 
3
+ ## Run Stack locally
4
+
5
+ A rake task is included to run the Elastic Enterprise Search stack locally via Docker:
6
+
7
+ ```
8
+ $ rake stack[7.10.0]
9
+ ```
10
+
11
+ This will run Elastic Enterprise Search in http://localhost:3002
12
+ - Username: `enterprise_search`
13
+ - Password: `changeme`
14
+
15
+ The version of the Elastic Enterprise Search Stack to use should be the same as tags of `https://www.docker.elastic.co/r/enterprise-search`. You can also use SNAPSHOT builds such as `8.0.0-SNAPSHOT`, `7.11-SNAPSHOT`, etc.
16
+
17
+ ## Running Tests
18
+
19
+ Unit tests for the clients:
20
+
21
+ ```
22
+ $ rake spec:client
23
+ ```
24
+
25
+ Integration tests: you need to have an instance of Enterprise Search running either locally or remotely, and specify the host and credentials in environment variables (see below for a complete dockerized setup). If you're using the included rake task `rake stack[:version]`, you can run the integration tests with the following command:
26
+
27
+ ```
28
+ $ ELASTIC_ENTERPRISE_HOST='http://localhost:3002' \
29
+ ELASTIC_ENTERPRISE_USER='elastic' \
30
+ ELASTIC_ENTERPRISE_PASSWORD='changeme' \
31
+ rake spec:integration
32
+ ```
33
+
34
+ Run integration tests completely within containers, the way we run them on our CI:
35
+ ```
36
+ RUNSCRIPTS=enterprise-search STACK_VERSION=7.10.0 ./.ci/run-tests
37
+ ```
38
+
39
+
3
40
  ## Contributing Code Changes
4
41
 
5
42
  1. Please make sure you have signed the [Contributor License
data/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ Elastic Enterprise Search Ruby Client
2
+ Copyright 2021 Elasticsearch B.V.
data/README.md CHANGED
@@ -6,48 +6,44 @@
6
6
 
7
7
  Official Ruby API client for [Elastic Enterprise Search](https://www.elastic.co/enterprise-search). Use this gem to integrate App Search and Workplace Search into your Ruby code.
8
8
 
9
- ## Documentation
10
-
11
- [See the documentation](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/index.html) for compatibility info, configuring, and an API reference.
12
-
13
- ## Development
14
-
15
- ### Run Stack locally
9
+ ## Installation
16
10
 
17
- A rake task is included to run the Elastic Enterprise Search stack locally via Docker:
11
+ Install the `elastic-enterprise-search` gem from [Rubygems](https://rubygems.org/gems/elastic-enterprise-search):
18
12
 
19
13
  ```
20
- $ rake stack[7.10.0]
14
+ $ gem install elastic-enterprise-search
21
15
  ```
22
16
 
23
- This will run Elastic Enterprise Search in http://localhost:3002
24
- - Username: `enterprise_search`
25
- - Password: `changeme`
17
+ Or add it to your project's Gemfile:
26
18
 
27
- The version of the Elastic Enterprise Search Stack to use should be the same as tags of `https://www.docker.elastic.co/r/enterprise-search`. You can also use SNAPSHOT builds such as `8.0.0-SNAPSHOT`, `7.11-SNAPSHOT`, etc.
19
+ ```ruby
20
+ gem 'elastic-enterprise-search', 'VERSION'
21
+ ```
28
22
 
29
- ### Running Tests
23
+ The Enterprise Search client is implemented with [`elastic-transport`](https://github.com/elastic/elastic-transport-ruby/) as the HTTP layer, which uses [Faraday](https://rubygems.org/gems/faraday). Faraday supports several [adapters](https://lostisland.github.io/faraday/adapters/) and will use `Net::HTTP` by default. For optimal performance with the Enterprise Search API, we suggest using an HTTP library which supports persistent ("keep-alive") connections. For the standard Ruby implementation, this could be https://github.com/drbrain/net-http-persistent[Net::HTTP::Persistent], [patron](https://github.com/toland/patron) or [Typhoeus](https://github.com/typhoeus/typhoeus). For JRuby, [Manticore](https://github.com/cheald/manticore) is a great option as well. Require the library for the adapter in your code and then pass in the `:adapter` parameter to the client when you initialize it:
30
24
 
31
- Unit tests for the clients:
25
+ ```ruby
26
+ require 'elastic-enterprise-search'
27
+ require 'faraday/net_http_persistent'
32
28
 
29
+ client = Elastic::EnterpriseSearch::Client.new(adapter: :net_http_persistent)
33
30
  ```
34
- $ rake spec:client
35
- ```
31
+ If an adapter is not specified, the client will try to auto-detect available libraries and use the best available HTTP client.
36
32
 
37
- Integration tests: you need to have an instance of Enterprise Search running either locally or remotely, and specify the host and credentials in environment variables (see below for a complete dockerized setup). If you're using the included rake task `rake stack[:version]`, you can run the integration tests with the following command:
33
+ ## Documentation
38
34
 
39
- ```
40
- $ ELASTIC_ENTERPRISE_HOST='http://localhost:3002' \
41
- ELASTIC_ENTERPRISE_USER='elastic' \
42
- ELASTIC_ENTERPRISE_PASSWORD='changeme' \
43
- rake spec:integration
44
- ```
35
+ [See the documentation](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/index.html) for usage, code examples, configuring the client, and an API reference.
45
36
 
46
- Run integration tests completely within containers, the way we run them on our CI:
47
- ```
48
- RUNSCRIPTS=enterprise-search STACK_VERSION=7.10.0 ./.ci/run-tests
49
- ```
37
+ See code examples of usage for the [Enteprise Search](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/enterprise-search-api.html), [App Search](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/app-search-api.html) and [Workplace Search](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/workplace-search-api.html) APIs.
38
+
39
+ ## Compatibility
40
+
41
+ We follow Ruby’s own maintenance policy and officially support all currently maintained versions per [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/).
42
+
43
+ ## Development
44
+
45
+ See [CONTRIBUTING](https://github.com/elastic/enterprise-search-ruby/blob/main/CONTRIBUTING.md).
50
46
 
51
47
  ## License
52
48
 
53
- Apache-2.0
49
+ This software is licensed under the [Apache 2 license](./LICENSE). See [NOTICE](./NOTICE).
@@ -8,7 +8,7 @@ This document includes examples for different API requests. Please refer to the
8
8
  [source,rb]
9
9
  ----------------------------
10
10
  # Create an engine
11
- client.create_engine(name: 'videogames')
11
+ client.create_engine(body: { name: 'videogames' })
12
12
 
13
13
  # List all engines
14
14
  client.list_engines
@@ -30,7 +30,7 @@ body = {
30
30
  type: 'meta',
31
31
  source_engines: [ 'books', 'videogames' ]
32
32
  }
33
- client.create_engine(name: engine_name, body: body)
33
+ client.create_engine(body: body)
34
34
 
35
35
  # Add a source engine to a meta engine:
36
36
  client.add_meta_engine_source(meta_engine_name, source_engines: ['engine1', 'engine2'])
@@ -123,11 +123,13 @@ client.delete_synonym_set(engine_name, synonym_set_id: id)
123
123
  ----------------------------
124
124
  # Create a curation
125
125
  client.create_curation(
126
- engine_name,
127
- queries: ['query1'],
128
- promoted: ['doc-id1'],
129
- hidden: ['doc-id2']
130
- )
126
+ engine_name,
127
+ body: {
128
+ queries: ['query1'],
129
+ promoted: ['doc-id1'],
130
+ hidden: ['doc-id2']
131
+ }
132
+ )
131
133
 
132
134
  # Retrieve a curation by id:
133
135
  client.curation(engine_name, curation_id: 'cur-id')
@@ -135,10 +137,14 @@ client.curation(engine_name, curation_id: 'cur-id')
135
137
  # Update an existing curation:
136
138
  client.put_curation(
137
139
  engine_name,
138
- curation_id: 'cur-id',
139
- queries: ['query1'],
140
- promoted: ['doc-id2'],
141
- hidden: ['doc-id1']
140
+ {
141
+ curation_id: 'cur-id',
142
+ body: {
143
+ queries: ['query1'],
144
+ promoted: ['doc-id2'],
145
+ hidden: ['doc-id1']
146
+ }
147
+ }
142
148
  )
143
149
 
144
150
  # List existing curations:
@@ -178,13 +184,6 @@ client.delete_api_key(api_key_name: name)
178
184
 
179
185
  === Web Crawler
180
186
 
181
- [CAUTION]
182
- ====
183
- The Elastic Enterprise Search web crawler API is a *beta* feature.
184
- Beta features are subject to change and are not covered by the support SLA of general release (GA) features.
185
- Elastic plans to promote this feature to GA in a future release.
186
- ====
187
-
188
187
  See https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html[Web Crawler API reference] for more information.
189
188
 
190
189
  [source,rb]
@@ -304,28 +303,37 @@ client.crawler_process_crawl_denied_urls(engine_name, process_crawl_id: id)
304
303
  # Cancel an active crawl request, stopping a running crawl if needed.
305
304
  client.delete_crawler_active_crawl_request(engine_name)
306
305
  ----------------------------
307
- === Adaptive Relevance
308
-
309
306
 
310
- The adaptive relevance API is a **beta** feature. Beta features are subject to change and are not covered by the support SLA of general release (GA) features. Elastic plans to promote this feature to GA in a future release. The adaptive relevance API is not available at all Elastic subscription levels. Refer to the Elastic subscriptions pages for https://www.elastic.co/subscriptions/cloud[Elastic Cloud] and https://www.elastic.co/subscriptions[self-managed] deployments.
307
+ === Adaptive Relevance Suggestions
311
308
 
312
309
  [source,rb]
313
310
  ----------------------------
314
- # Retrieve adaptive relevance settings
315
- client.adaptive_relevance_settings(engine_name)
311
+ # Update an adaptive relevance suggestion
312
+ body = [{ query: 'forest', type: 'curation', status: 'applied' }]
313
+ client.put_adaptive_relevance_suggestions(engine_name, body: body)
316
314
 
317
- # Update adaptive relevance settings for an engine
318
- body = { curation: { enabled: true } }
319
- client.put_adaptive_relevance_settings(engine_name, body: body)
315
+ # Retrieve an adaptive relevance suggestion
316
+ client.adaptive_relevance_suggestions(engine_name, search_suggestion_query: 'test')
320
317
 
321
- # List suggestions
318
+ # List adaptive relevance suggestions
322
319
  client.list_adaptive_relevance_suggestions(engine_name)
320
+ ----------------------------
323
321
 
324
- # Update adaptive relevance
325
- client.put_adaptive_relevance_suggestions(engine_name, body: body)
322
+ === Adaptive Relevance Settings
323
+
324
+ [source,rb]
325
+ ----------------------------
326
+ # Show the settings for an engine
327
+ client.adaptive_relevance_settings(engine_name)
328
+
329
+ # Update relevance settings
330
+ body = {
331
+ curation: { enabled: true }
332
+ }
333
+ client.put_adaptive_relevance_settings(engine_name, body: body)
326
334
 
327
- # Retrive adaptive relevance
328
- client.adaptive_relevance_suggestions(engine_name, search_suggestion_query: 'suggestion')
335
+ # Refresh adaptive relevance update process
336
+ client.refresh_adaptive_relevance_update_process(engine_name, adaptive_relevance_suggestion_type: 'curation')
329
337
  ----------------------------
330
338
 
331
339
  === Other API Endpoints
@@ -14,11 +14,19 @@ For **Elastic Enterprise Search 7.0** and later, use the major version 7 (`7.x.y
14
14
 
15
15
  [discrete]
16
16
  === HTTP Library
17
- This library uses https://github.com/elastic/elasticsearch-ruby/tree/main/elasticsearch-transport[elasticsearch-transport], the low-level Ruby client for connecting to an Elasticsearch cluster - also used in the official https://github.com/elastic/elasticsearch-ruby[Elasticsearch Ruby Client].
17
+ This library uses https://github.com/elastic/elastic-transport-ruby[elastic-transport], the low-level Ruby client for connecting to an Elastic clusters - also used in the official https://github.com/elastic/elasticsearch-ruby[Elasticsearch Ruby Client]. It uses https://rubygems.org/gems/faraday[Faraday], which supports several https://lostisland.github.io/faraday/adapters/[adapters] and will use `Net::HTTP` by default. For optimal performance with the Enterprise Search API, we suggest using an HTTP library which supports persistent ("keep-alive") connections. For the standard Ruby implementation, this could be https://github.com/drbrain/net-http-persistent[Net::HTTP::Persistent], https://github.com/toland/patron[patron] or https://github.com/typhoeus/typhoeus[Typhoeus]. For JRuby, https://github.com/cheald/manticore[Manticore] is a great option as well. Require the library for the adapter in your code and then pass in the `:adapter` parameter to the client when you initialize it:
18
18
 
19
- All requests, if successful, will return an `Elasticsearch::Transport::Transport::Response` instance. You can access the response `body`, `headers` and `status`.
19
+ [source,ruby]
20
+ ---------------------------------------------------
21
+ require 'elastic-enterprise-search'
22
+ require 'faraday/net_http_persistent'
20
23
 
21
- `elasticsearch-transport` defines a https://github.com/elasticsearch/elasticsearch-ruby/blob/main/elasticsearch-transport/lib/elasticsearch/transport/transport/errors.rb[number of exception classes] for various client and server errors, as well as unsuccessful HTTP responses, making it possible to rescue specific exceptions with desired granularity. More details https://github.com/elastic/elasticsearch-ruby/tree/main/elasticsearch-transport#exception-handling[here]. You can find the full documentation for `elasticsearch-transport` at https://rubydoc.info/gems/elasticsearch-transport[RubyDoc].
24
+ client = Elastic::EnterpriseSearch::Client.new(adapter: :net_http_persistent)
25
+ ---------------------------------------------------
26
+
27
+ All requests, if successful, will return an `Elastic::Transport::Transport::Response` instance. You can access the response `body`, `headers` and `status`.
28
+
29
+ `elastic-transport` defines a https://github.com/elastic/elastic-transport-ruby/blob/main/lib/elastic/transport/transport/errors.rb[number of exception classes] for various client and server errors, as well as unsuccessful HTTP responses, making it possible to rescue specific exceptions with desired granularity. More details https://github.com/elastic/elastic-transport-ruby#exception-handling[here]. You can find the full documentation for `elastic-transport` at https://rubydoc.info/gems/elastic-transport[RubyDoc].
22
30
 
23
31
  The clients pass different options to transport, you can check them out https://rubydoc.info/github/elastic/enterprise-search-ruby/Elastic/EnterpriseSearch/Client[on RubyDocs].
24
32
 
@@ -26,3 +26,13 @@
26
26
 
27
27
  - Updates source code documentation for `current_page` and `page_size` parameters from type `String` to `Integer`.
28
28
  - In `multi_search`, the body parameter is renamed to `body` from `queries` to avoid repetition and potential confusion.
29
+
30
+ [discrete]
31
+ ==== Workplace Search
32
+
33
+ - Body parameter renamed to `document_ids` in `delete_documents`:
34
+
35
+ [source,rb]
36
+ ----------------------------
37
+ client.delete_documents(content_source_id, document_ids: ['e68fbc2688f1', 'c535e226aee3'])
38
+ ----------------------------
@@ -1,16 +1,4 @@
1
1
  [[release_notes_714]]
2
- === 7.14 Release notes
3
-
4
- [discrete]
5
- [[release_notes_7141]]
6
- === 7.14.1 Release notes
7
-
8
- ==== Dependency fix
9
-
10
- Updates dependency on `elasticsearch-transport` to be more open. At least 7.11 is required, but this way it can be used with different versions of the `elasticsearch` gem (bigger than or equal to `7.11`) in the same project, without a conflict in `elasticsearch-transport`. When instantiating transport, we now check if version is `< 7.14` so we use the right class.
11
-
12
- [discrete]
13
- [[release_notes_7140]]
14
2
  === 7.14.0 Release notes
15
3
 
16
4
  [discrete]
@@ -1,16 +1,4 @@
1
1
  [[release_notes_715]]
2
- === 7.15 Release notes
3
-
4
- [discrete]
5
- [[release_notes_7151]]
6
- === 7.15.1 Release notes
7
-
8
- ==== Dependency fix
9
-
10
- Updates dependency on `elasticsearch-transport` to be more open. At least 7.11 is required, but this way it can be used with different versions of the `elasticsearch` gem (bigger than or equal to `7.11`) in the same project, without a conflict in `elasticsearch-transport`. When instantiating transport, we now check if version is `< 7.14` so we use the right class.
11
-
12
- [discrete]
13
- [[release_notes_7150]]
14
2
  === 7.15.0 Release notes
15
3
 
16
4
  [discrete]
@@ -0,0 +1,9 @@
1
+ [[release_notes_717]]
2
+ === 7.17 Release notes
3
+
4
+ [discrete]
5
+ ==== General
6
+
7
+ - Tested with Elastic Enterprise Search API version 7.17.0.
8
+ - Last release in the `7.x` branch.
9
+ - Tested with Ruby 2.6, 2.7, 3.0, 3.1
@@ -0,0 +1,117 @@
1
+ [[release_notes_80]]
2
+ === 8.0.0 Release notes
3
+
4
+ [discrete]
5
+ ==== General
6
+
7
+ First release in the `8.x` branch of the client.
8
+
9
+ - Tested with Elastic Enterprise Search API version 8.0-SNAPSHOT.
10
+ - Tested with Ruby 2.7, 3.0, 3.1, JRuby 9.3. Older versions of Ruby have reached end of life and been removed from the testing matrices. Minimum required Ruby version is Ruby 2.6 to keep compatibility with JRuby 9.3, but it may be upgraded to 2.7 once JRuby 9.4 comes out.
11
+ - API: Updated endpoints that make a `GET` or `DELETE` requests to not have a `body`. Requests with `PUT` and `POST` now expect most parameters to be in the request body. Parameters that were available as both arguments and in the body are now just in the body.
12
+ - API: An updated generator is being used to generate the endpoint code. The source code documentation has better typing hints for parameters.
13
+
14
+ [discrete]
15
+ ==== Response Object
16
+
17
+ * Requests now return an `Elastic::API::Response` object. This behaves exactly the same as the previous response (`Elastic::Transport::Transport::Response`) but expands its functionality. With the previous response object, the body of the response had to be accessed calling the `body` method on the response. This new object behaves like the response.body Hash object, except when the `status` or `headers` are sent to it. This makes it easier to access the response data. Example:
18
+
19
+ +
20
+ [source,rb]
21
+ ----------------------------
22
+ client = Elastic::EnterpriseSearch::Client.new(
23
+ host: 'http://localhost:3002',
24
+ http_auth: {user: 'elastic', password: 'changeme'}
25
+ )
26
+ response = client.health
27
+ response.class
28
+ # => Elastic::API::Response
29
+ response['version']['number']
30
+ # => "8.1.4"
31
+ response.body['version']['number']
32
+ # => "8.1.4"
33
+ response.status
34
+ # => 200
35
+ response.headers
36
+ # =>
37
+ {"date"=>"Tue, 10 May 2022 09:01:10 GMT",
38
+ "content-type"=>"application/json;charset=utf-8",
39
+ "etag"=>"W/\"etag--gzip\"",
40
+ "cache-control"=>"max-age=0, private, must-revalidate",
41
+ "x-request-id"=>"id",
42
+ "x-runtime"=>"0.023468",
43
+ "vary"=>"Accept-Encoding, User-Agent",
44
+ "content-length"=>"755",
45
+ "server"=>"Jetty(9.4.43.v20210629)"}
46
+ ----------------------------
47
+
48
+ [discrete]
49
+ ==== App Search
50
+
51
+ [discrete]
52
+ ===== API Changes
53
+
54
+ - API Logs: Removes `date` parameters for filters. This API requires a nested date object under `filters` (now passed in via the body) containing `from` and `to` keys formatted in accordance with RFC3339. The App Search client provides the helper function `date_to_rfc3339` which receives a date String and converts it to the right format.
55
+ - Crawler API : Internal Url updated from `v0` to `v1`. `create_crawler_crawl_rule` body is a required parameter (`order`, `policy`, `rule`, `pattern`). `create_crawler_entry_point` body is required (for `value`). `create_crawler_sitemap` body is required (for `url`). `put_crawler_crawl_rule` body is required (`order`, `policy`, `rule`, `pattern`). `put_crawler_crawl_schedule` body is required (`frequency`, `unit`). `put_crawler_entry_point` body is required (for `value`). `put_crawler_sitemap` body is required (`url`).
56
+ - Curations API: parameters for `create_curation` and `put_curation` must be passed in inside the body parameter now.
57
+ - Engine APIs: `create_engine` removes the `name` parameter. It must be passed in inside the body parameter now.
58
+ - Log Click: `log_clickthrough` now requires `body`, the parameter `query` and `document_id` are required.
59
+ - Search: When using `search`, query can no longer be sent as an argument. The method will raise `ArgumentError` if no body is sent, since `query` is a required parameter in the body.
60
+ - APIs where `body` has been removed since it's not used: `delete_engine`, `engine`, `list_engines`, `curation`, `delete_curation`, `schema`, `api_key`, `delete_api_key`, `list_api_keys`, `delete_synonym_set`, `list_synonym_set`, `synonym_set`, `list_documents`, `reset_search_settings`, `search_settings`, `crawler_active_crawl_request`, `crawler_crawl_request`, `crawler_crawl_schedule`, `crawler_domain`, `crawler_metrics`, `crawler_overview`, `crawler_process_crawl`, `crawler_process_crawl_denied_urls`, `crawler_user_agent`, `delete_crawler_active_crawl_request`, `delete_crawler_crawl_rule`, `delete_crawler_crawl_schedule`, `delete_crawler_domain`, `delete_crawler_entry_point`, `delete_crawler_sitemap`, `list_crawler_crawl_requests`, `list_crawler_process_crawls`.
61
+
62
+ [discrete]
63
+ ===== New APIs
64
+
65
+ * `list_crawler_domain`: Lists crawler domains given an engine.
66
+ * Adaptive Relevance Suggestion APIs:
67
+ ** `adaptive_relevance_suggestions` - Retrieves adaptive relevance for a single query.
68
+ ** `list_adaptive_relevance_suggestions` - List the adaptive relevance suggestions for a given engine.
69
+ ** `put_adaptive_relevance_suggestions` - Update adaptive relevance.
70
+ * Adaptive Relevance Settings APIs:
71
+ ** `adaptive_relevance_settings` - Retrieve adaptive relevance settings.
72
+ ** `put_adaptive_relevance_settings` - Update adaptive relevance settings.
73
+ ** `refresh_adaptive_relevance_update_process` - Update suggestions process refresh.
74
+
75
+ [discrete]
76
+ ==== Enterprise Search
77
+
78
+ - Read-Only API: `put_read_only` body is now required with the enabled object: `{enabled: true|false}`.
79
+ - APIs where `body` has been removed since it's not used: `health`, `read_only`, `stats`, `version`.
80
+
81
+ [discrete]
82
+ ==== Workplace Search
83
+
84
+ [discrete]
85
+ ===== API Changes
86
+
87
+ * Permissions APIs have been removed: `add_user_permissions`, `list_permissions`, `put_user_permissions`, `remove_user_permissions`, `user_permissions`.
88
+ * `current_user` removed `get_token` parameter.
89
+ * Analytics: `create_analytics_events` will raise ArgumentError if body is missing (Required: type, query_id, page, content_source_id, document_id, rank)
90
+ * Content Sources: `create_content_source` will raise ArgumentError if body is missing (Required: name). `name` cannot be passed in as a parameter anymore, needs to be in the body. `put_content_source` will raise ArgumentError if body is missing (Required: name, is_searchable). `put_content_source_icons` will raise ArgumentError if body is missing.
91
+ * External Identities: `create_external_identity` will raise ArgumentError if body is missing (Required: external_user_id, external_user_properties, permissions). Body parameters have changed:
92
+
93
+ +
94
+ [source,rb]
95
+ ----------------------------
96
+ body = {
97
+ external_user_id: external_user_id,
98
+ permissions: [],
99
+ external_user_properties: [
100
+ 'attribute_name' => '_elasticsearch_username',
101
+ 'attribute_value' => 'fernando'
102
+ ]
103
+ }
104
+ client.create_external_identity(content_source_id, body: body)
105
+ ----------------------------
106
+ +
107
+ In `delete_external_identity`, `external_identity` and `put_external_identity` the required parameter changed from `user` to `external_user_id`.
108
+ See https://www.elastic.co/guide/en/workplace-search/current/workplace-search-external-identities-api.html
109
+ * Search: Parameters need to be passed in via body to `search`. It will raise ArgumentError if body is missing.
110
+ * Documents: `delete_documents` will raise ArgumentError if body is missing (Required document_ids).
111
+ * Sync Jobs: `command_sync_jobs` will raise ArgumentError if body is missing.
112
+ * Synonyms: `create_batch_synonym_sets`, `put_synonym_set` will raise ArgumentError if body is missing.
113
+ * APIs where `body` has been removed since it's not used: `auto_query_refinement_details`, `content_source`, `current_user`, `delete_content_source`, `delete_external_identity`, `delete_synonym_set`, `document`, `external_identity`, `list_content_sources`, `list_external_identities`, `put_triggers_blocklist`, `synonym_set`, `triggers_blocklist`.
114
+
115
+ [discrete]
116
+ ===== New APIs
117
+ - `list_documents`: Lists documents from a custom content source.
@@ -1,10 +1,14 @@
1
1
  [[release_notes]]
2
2
  == Release Notes
3
3
 
4
+ [discrete]
5
+ === 8.x
6
+ * <<release_notes_80, 8.0.0 Release Notes>>
4
7
 
5
8
  [discrete]
6
9
  === 7.x
7
10
 
11
+ * <<release_notes_717, 7.17.0 Release Notes>>
8
12
  * <<release_notes_716, 7.16.0 Release Notes>>
9
13
  * <<release_notes_715, 7.15.0 Release Notes>>
10
14
  * <<release_notes_714, 7.14.0 Release Notes>>
@@ -13,6 +17,8 @@
13
17
  * <<release_notes_711, 7.11.0 Release Notes>>
14
18
  * <<release_notes_710, 7.10.0.beta.1 Release Notes>>
15
19
 
20
+ include::80.asciidoc[]
21
+ include::717.asciidoc[]
16
22
  include::716.asciidoc[]
17
23
  include::715.asciidoc[]
18
24
  include::714.asciidoc[]
@@ -6,10 +6,10 @@
6
6
  [source,rb]
7
7
  ----------------------------
8
8
  # Create a custom content source
9
- client.create_content_source(name: 'test')
9
+ client.create_content_source(body: { name: 'test' })
10
10
 
11
11
  # Retrieve a content source by ID
12
- content_source_id = client.create_content_source(name: 'books').body['id']
12
+ content_source_id = client.create_content_source(body: { name: 'books' }).body['id']
13
13
  client.content_source(content_source_id)
14
14
 
15
15
  # Delete a content source by ID
@@ -139,21 +139,28 @@ client.remove_user_permissions(
139
139
  [source,rb]
140
140
  ----------------------------
141
141
  # Create external identities
142
- body = { user: 'elastic_user', source_user_id: 'example@elastic.co' }
142
+ body = {
143
+ external_user_id: external_user_id,
144
+ permissions: [],
145
+ external_user_properties: [
146
+ 'attribute_name' => '_elasticsearch_username',
147
+ 'attribute_value' => 'fernando'
148
+ ]
149
+ }
143
150
  client.create_external_identity(content_source_id, body: body)
144
151
 
145
152
  # Retrieve an external identity
146
- client.external_identity(content_source_id, user: 'elastic_user')
153
+ client.external_identity(content_source_id, external_user_id: external_user_id)
147
154
 
148
155
  # List external identities
149
156
  client.list_external_identities(content_source_id)
150
157
 
151
158
  # Update external identity
152
- body = { source_user_id: 'example2@elastic.co' }
153
- client.put_external_identity(content_source_id, user: 'elastic_user', body: body)
159
+ body = { external_user_id: external_user_id, permissions: ['permission1'] }
160
+ client.put_external_identity(content_source_id, external_user_id: external_user_id, body: body)
154
161
 
155
162
  # Delete an external identity
156
- client.delete_external_identity(content_source_id, user: 'elastic_user')
163
+ client.delete_external_identity(content_source_id, external_user_id: external_user_id)
157
164
  ----------------------------
158
165
 
159
166
  === Search