elastic-enterprise-search 8.0.0 → 8.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/test-matrix.yml +1 -1
  3. data/.github/workflows/testing.yml +1 -2
  4. data/docs/guide/connecting.asciidoc +0 -1
  5. data/docs/guide/overview.asciidoc +30 -1
  6. data/docs/guide/release_notes/714.asciidoc +12 -0
  7. data/docs/guide/release_notes/715.asciidoc +12 -0
  8. data/docs/guide/release_notes/80.asciidoc +11 -0
  9. data/docs/guide/release_notes/81.asciidoc +19 -0
  10. data/docs/guide/release_notes/index.asciidoc +2 -0
  11. data/docs/guide/workplace-search-api.asciidoc +24 -4
  12. data/lib/elastic/app-search/api/adaptive_relevance_suggestions.rb +0 -1
  13. data/lib/elastic/app-search/api/add_meta_engine_source.rb +0 -1
  14. data/lib/elastic/app-search/api/api_key.rb +0 -1
  15. data/lib/elastic/app-search/api/api_logs.rb +0 -1
  16. data/lib/elastic/app-search/api/count_analytics.rb +0 -1
  17. data/lib/elastic/app-search/api/crawler_crawl_request.rb +0 -1
  18. data/lib/elastic/app-search/api/crawler_domain.rb +0 -1
  19. data/lib/elastic/app-search/api/crawler_domain_validation_result.rb +0 -1
  20. data/lib/elastic/app-search/api/crawler_process_crawl.rb +0 -1
  21. data/lib/elastic/app-search/api/crawler_process_crawl_denied_urls.rb +0 -1
  22. data/lib/elastic/app-search/api/crawler_url_extraction_result.rb +1 -2
  23. data/lib/elastic/app-search/api/crawler_url_tracing_result.rb +0 -1
  24. data/lib/elastic/app-search/api/crawler_url_validation_result.rb +0 -1
  25. data/lib/elastic/app-search/api/create_api_key.rb +0 -1
  26. data/lib/elastic/app-search/api/create_crawler_crawl_request.rb +1 -1
  27. data/lib/elastic/app-search/api/create_crawler_crawl_rule.rb +0 -1
  28. data/lib/elastic/app-search/api/create_crawler_domain.rb +0 -1
  29. data/lib/elastic/app-search/api/create_crawler_entry_point.rb +0 -1
  30. data/lib/elastic/app-search/api/create_crawler_process_crawl.rb +0 -1
  31. data/lib/elastic/app-search/api/create_crawler_sitemap.rb +0 -1
  32. data/lib/elastic/app-search/api/create_curation.rb +0 -1
  33. data/lib/elastic/app-search/api/create_engine.rb +0 -1
  34. data/lib/elastic/app-search/api/create_synonym_set.rb +0 -1
  35. data/lib/elastic/app-search/api/curation.rb +0 -1
  36. data/lib/elastic/app-search/api/delete_api_key.rb +0 -1
  37. data/lib/elastic/app-search/api/delete_crawler_crawl_rule.rb +0 -1
  38. data/lib/elastic/app-search/api/delete_crawler_domain.rb +0 -1
  39. data/lib/elastic/app-search/api/delete_crawler_entry_point.rb +0 -1
  40. data/lib/elastic/app-search/api/delete_crawler_sitemap.rb +0 -1
  41. data/lib/elastic/app-search/api/delete_curation.rb +0 -1
  42. data/lib/elastic/app-search/api/delete_documents.rb +0 -1
  43. data/lib/elastic/app-search/api/delete_meta_engine_source.rb +0 -1
  44. data/lib/elastic/app-search/api/delete_synonym_set.rb +0 -1
  45. data/lib/elastic/app-search/api/documents.rb +0 -1
  46. data/lib/elastic/app-search/api/index_documents.rb +0 -1
  47. data/lib/elastic/app-search/api/list_adaptive_relevance_suggestions.rb +0 -1
  48. data/lib/elastic/app-search/api/log_clickthrough.rb +0 -1
  49. data/lib/elastic/app-search/api/put_adaptive_relevance_settings.rb +0 -1
  50. data/lib/elastic/app-search/api/put_adaptive_relevance_suggestions.rb +0 -1
  51. data/lib/elastic/app-search/api/put_api_key.rb +0 -1
  52. data/lib/elastic/app-search/api/put_crawler_crawl_rule.rb +0 -1
  53. data/lib/elastic/app-search/api/put_crawler_crawl_schedule.rb +0 -1
  54. data/lib/elastic/app-search/api/put_crawler_domain.rb +0 -1
  55. data/lib/elastic/app-search/api/put_crawler_entry_point.rb +0 -1
  56. data/lib/elastic/app-search/api/put_crawler_sitemap.rb +0 -1
  57. data/lib/elastic/app-search/api/put_curation.rb +0 -1
  58. data/lib/elastic/app-search/api/put_documents.rb +0 -1
  59. data/lib/elastic/app-search/api/put_schema.rb +0 -1
  60. data/lib/elastic/app-search/api/put_search_settings.rb +0 -1
  61. data/lib/elastic/app-search/api/put_synonym_set.rb +0 -1
  62. data/lib/elastic/app-search/api/query_suggestion.rb +0 -1
  63. data/lib/elastic/app-search/api/refresh_adaptive_relevance_update_process.rb +0 -1
  64. data/lib/elastic/app-search/api/search.rb +0 -1
  65. data/lib/elastic/app-search/api/synonym_set.rb +0 -1
  66. data/lib/elastic/app-search/api/top_clicks_analytics.rb +0 -1
  67. data/lib/elastic/app-search/api/top_queries_analytics.rb +0 -1
  68. data/lib/elastic/enterprise-search/api/put_read_only.rb +0 -1
  69. data/lib/elastic/enterprise-search/client.rb +13 -1
  70. data/lib/elastic/enterprise-search/version.rb +1 -1
  71. data/lib/elastic/workplace-search/workplace_search.rb +9 -2
  72. data/spec/workplace-search/client_spec.rb +10 -2
  73. metadata +4 -5
  74. data/.ci/jobs/elastic+enterprise-search-ruby+7.13.yml +0 -12
  75. data/.ci/jobs/elastic+enterprise-search-ruby+7.14.yml +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe3de694901dc1b16bef977ae8e1c5fbe17da770daa14cf59fbbe3c46588331a
4
- data.tar.gz: ca7d3672c8d91810d5ae0589f444ebc3992b7cb4673729b7c45e1e3184a43555
3
+ metadata.gz: 7c6b7f543ecfbb56fa72e108d6c86b8aad6c4185e14654ab1e32cc739054073e
4
+ data.tar.gz: b4692ff93dd20556e6dd8e758577c107c02c2ed0b114bab15aad094ace4dba37
5
5
  SHA512:
6
- metadata.gz: 580b81ecdca1b5e7522b3a5b54e237b29bccad3d99b93af9161c0f54196e4960436208b463f7dd6b416faef68e048c4c1b7bb4efe1429fcf7601184b0df35384
7
- data.tar.gz: 05d5729c7254f93b0ca8b77a4400195b72854bf9973c2a499b23b90b2ecae8c20d82dc97fa68f2a05a7947305deab8d0578b92fc89b224a8c23395fdedfb0388
6
+ metadata.gz: 428fc9ca35fcf144bf83e8ed51d71901f5faf6f8b933c6c5118d95af3aea859b14307c7473b891f49538890f127bfcc5c7980c04531c93ae7f5b22f99a056b72
7
+ data.tar.gz: 2dde8ce3996c9a6b0ee7e5fef81000ea9397c5c4c1ae0b54e3b61b8fb604508c1727cf61cf4a6ee87c86090e088e8d19e2a02effec877e637e76af74724109e6
data/.ci/test-matrix.yml CHANGED
@@ -5,7 +5,7 @@ RUBY_VERSION:
5
5
  - 2.7
6
6
 
7
7
  STACK_VERSION:
8
- - 8.0-SNAPSHOT
8
+ - 8.1-SNAPSHOT
9
9
 
10
10
  SERVICE:
11
11
  - appsearch
@@ -7,8 +7,7 @@ jobs:
7
7
  ENDPOINT: http://localhost:8080
8
8
  strategy:
9
9
  matrix:
10
- ruby: [ 2.7, 3.0, 3.1 ]
11
-
10
+ ruby: [ '2.7', '3.0', '3.1' ]
12
11
  runs-on: ubuntu-latest
13
12
  steps:
14
13
  - uses: actions/checkout@v2
@@ -1,7 +1,6 @@
1
1
  [[connecting]]
2
2
  == Connecting
3
3
 
4
-
5
4
  This page contains the information you need to connect and use the Client with Elastic Enterprise Search.
6
5
 
7
6
  **On this page**
@@ -14,6 +14,7 @@ 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
+
17
18
  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
19
 
19
20
  [source,ruby]
@@ -38,7 +39,7 @@ If you don't specify a host and port, the client will default to `http://localho
38
39
  [discrete]
39
40
  === Logging
40
41
 
41
- You can enable logging with the default logger by passing `log: true` as a parameter to the client's initializer, or pass in a Logger object with the `:logger` parameter:
42
+ You can enable logging with the default logger by passing `log: true` as a parameter to the client's initializer, or pass in a Logger object with the `:logger` parameter, any confoming logger implementation:
42
43
 
43
44
  [source,rb]
44
45
  ----------------------------
@@ -46,6 +47,34 @@ logger = MyLogger.new
46
47
  client = Elastic::EnterpriseSearch::Client.new(logger: logger)
47
48
  ----------------------------
48
49
 
50
+ To trace requests and responses in the _Curl_ format, set the `trace` argument:
51
+
52
+ [source,rb]
53
+ ----------------------------
54
+ > client = Elastic::EnterpriseSearch::Client.new(trace: true)
55
+ > client.health
56
+ curl -X GET -H 'x-elastic-client-meta: ent=8.3.0,rb=3.1.2,t=8.0.1,fd=1.10.0,nh=0.2.0, User-Agent: elastic-transport-ruby/8.0.1 (RUBY_VERSION: 3.1.2; linux x86_64; Faraday v1.10.0), Content-Type: application/json
57
+ ' 'http://localhost:9200/api/ent/v1/internal/health/?pretty'
58
+
59
+ # 2022-05-23T08:39:09+01:00 [200] (0.049s)
60
+ #
61
+ # {"name":"5b8067bf95fb", ...
62
+ =>
63
+ #<Elastic::API::Response:0x00007f9096e15f90
64
+ @response=
65
+ #<Elastic::Transport::Transport::Response:0x00007f9096e160a8
66
+ @body=
67
+ {"name"=>"5b8067bf95fb",
68
+ ...
69
+ ----------------------------
70
+
71
+ This will use the `elastic-transport` default logger. But you can pass in a custom logger with:
72
+
73
+ [source,rb]
74
+ ----------------------------
75
+ client = Elastic::EnterpriseSearch::Client.new(tracer: my_tracer)
76
+ ----------------------------
77
+
49
78
  [discrete]
50
79
  === License
51
80
 
@@ -1,4 +1,16 @@
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]]
2
14
  === 7.14.0 Release notes
3
15
 
4
16
  [discrete]
@@ -1,4 +1,16 @@
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]]
2
14
  === 7.15.0 Release notes
3
15
 
4
16
  [discrete]
@@ -1,4 +1,15 @@
1
1
  [[release_notes_80]]
2
+ === 8.0 Release notes
3
+
4
+ [discrete]
5
+ [[release_notes_801]]
6
+ === 8.0.1 Release notes
7
+
8
+ - Adds tracer parameters to enable tracing in elastic-transport. See https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/overview.html#_logging[logging] for more information.
9
+ - Updates Workplace Search OAuth implementation. See https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/workplace-search-api.html#ws-oauth-authentication[OAuth Authentication] for changes in the OAuth process.
10
+
11
+ [discrete]
12
+ [[release_notes_800]]
2
13
  === 8.0.0 Release notes
3
14
 
4
15
  [discrete]
@@ -0,0 +1,19 @@
1
+ [[release_notes_81]]
2
+ === 8.1 Release notes
3
+
4
+ [discrete]
5
+ [[release_notes_811]]
6
+ === 8.1.1 Release notes
7
+
8
+ - Adds tracer parameters to enable tracing in elastic-transport. See https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/overview.html#_logging[logging] for more information.
9
+ - Updates Workplace Search OAuth implementation. See https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/workplace-search-api.html#ws-oauth-authentication[OAuth Authentication] for changes in the OAuth process.
10
+
11
+ [discrete]
12
+ [[release_notes_810]]
13
+ === 8.1.0 Release notes
14
+
15
+ [discrete]
16
+ ==== General
17
+
18
+ - Tested with Elastic Enterprise Search API version 8.1.0.
19
+ - 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.
@@ -3,6 +3,7 @@
3
3
 
4
4
  [discrete]
5
5
  === 8.x
6
+ * <<release_notes_81, 8.1.0 Release Notes>>
6
7
  * <<release_notes_80, 8.0.0 Release Notes>>
7
8
 
8
9
  [discrete]
@@ -17,6 +18,7 @@
17
18
  * <<release_notes_711, 7.11.0 Release Notes>>
18
19
  * <<release_notes_710, 7.10.0.beta.1 Release Notes>>
19
20
 
21
+ include::81.asciidoc[]
20
22
  include::80.asciidoc[]
21
23
  include::717.asciidoc[]
22
24
  include::716.asciidoc[]
@@ -76,22 +76,42 @@ client.delete_documents_by_query(content_source_id, query: query)
76
76
  [[ws-oauth-authentication]]
77
77
  === OAuth Authentication
78
78
 
79
- You need to configure the OAuth Application for Search in order to use the Workplace Search client's `search` and `create_analytics` endpoints. You need to follow the steps in https://www.elastic.co/guide/en/workplace-search/current/building-custom-search-workplace-search.html#configuring-search-oauth[Configuring the OAuth Application for Search] to retrieve the credentials: Client ID and Client Secret to request access tokens from the authentication server.
79
+ You need to configure the OAuth Application for Search in order to use the Workplace Search client's `search` and `create_analytics` endpoints. You need to follow the steps in https://www.elastic.co/guide/en/workplace-search/current/building-custom-search-workplace-search.html#configuring-search-oauth[Configuring the OAuth Application for Search] to retrieve the credentials: **Client ID** and **Client Secret** to request access tokens from the authentication server.
80
+
81
+ The client implements https://www.elastic.co/guide/en/workplace-search/current/building-custom-search-workplace-search.html#authenticating-search-user-confidential[Authenticating Users with a Confidential OAuth Flow]. It provides a helper to obtain the autorization URL directly from the client once you've set the necessary values.
82
+
83
+ The authorization endpoint is hosted by your Kibana deployment, so you need to provide the client with the https://www.elastic.co/guide/en/enterprise-search/current/endpoints-ref.html#kibana-base-url[base URL of your Kibana instance]. You can do this when you initialize the client:
84
+
85
+ [source,rb]
86
+ ----------------------------
87
+ client = Elastic::EnterpriseSearch::WorkplaceSearch::Client.new(http_auth: <access_token>, kibana_url: <kibana_url>)
88
+ ----------------------------
89
+
90
+ Or you can set in an existing client:
80
91
 
81
92
  [source,rb]
82
93
  ----------------------------
83
94
  client = Elastic::EnterpriseSearch::WorkplaceSearch::Client.new(http_auth: <access_token>)
95
+ client.kibana_url = <kibana_url>
96
+ ----------------------------
84
97
 
98
+ Once you've instantiated a client and the base URL of your Kibana instance is set, you can get the URL for authorization like so:
99
+ [source,rb]
100
+ ----------------------------
101
+ # You get the values for client_id and client_secret when configuring the OAuth Application:
85
102
  client_id = <client_id>
86
103
  client_secret = <client_secret>
87
104
  redirect_uri = <redirect_uri>
88
105
 
89
106
  # Get the authorization URL:
90
107
  client.authorization_url(client_id, redirect_uri)
91
- > https://host:port/ws/oauth/authorize?response_type=code&client_id=client_id&redirect_uri=https%3A%2F%2Flocalhost%3A3002
108
+ > https://kibana_url/app/enterprise_search/workplace_search/p/oauth/authorize?response_type=code&client_id=client_id&redirect_uri=https%3A%2F%2Flocalhost%3A3002
109
+
92
110
  ----------------------------
93
111
 
94
- Open the URL to authorize your application. Successful authorization redirects the user in accordance to the redirect URI provided (and configured for the application). The application server must now request for an access_token, which is generated by Workplace Search using the oauth/token endpoint, using the Client ID and Client Secret.
112
+ Open the URL to authorize your application. Successful authorization redirects the user in accordance to the redirect URI provided (and configured for the application).
113
+
114
+ The application server must now request for an `access_token`, which is generated by Workplace Search using the `oauth/token` endpoint, using the **Client ID** and **Client Secret**.
95
115
 
96
116
  [source,rb]
97
117
  ----------------------------
@@ -100,7 +120,7 @@ authorization_code = '<paste code from redirect>'
100
120
  access_token = client.request_access_token(client_id, client_secret, authorization_code, redirect_uri)
101
121
 
102
122
  # The access_token can now be used to issue a search request:
103
- client.search(body: {query: 'search query'}, access_token: access_token)
123
+ client.search(body: { query: 'search query' }, access_token: access_token)
104
124
  ----------------------------
105
125
 
106
126
  See https://www.elastic.co/guide/en/workplace-search/current/workplace-search-search-api.html#search-api-overview[Search API Overview] for more search parameters.
@@ -44,7 +44,6 @@ module Elastic
44
44
 
45
45
  search_suggestion_query = arguments.delete(:search_suggestion_query)
46
46
  body = arguments.delete(:body) || {}
47
-
48
47
  headers = arguments.delete(:headers) || {}
49
48
  request(
50
49
  :post,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  source_engines = arguments.delete(:source_engines) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :post,
@@ -34,7 +34,6 @@ module Elastic
34
34
  raise ArgumentError, "Required parameter 'api_key_name' missing" unless arguments[:api_key_name]
35
35
 
36
36
  api_key_name = arguments.delete(:api_key_name)
37
-
38
37
  headers = arguments.delete(:headers) || {}
39
38
  request(
40
39
  :get,
@@ -40,7 +40,6 @@ module Elastic
40
40
  raise ArgumentError, "Required parameter 'body (filters)' missing" unless arguments[:body]
41
41
 
42
42
  body = arguments.delete(:body) || {}
43
-
44
43
  headers = arguments.delete(:headers) || {}
45
44
  request(
46
45
  :post,
@@ -37,7 +37,6 @@ module Elastic
37
37
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
38
38
 
39
39
  body = arguments.delete(:body) || {}
40
-
41
40
  headers = arguments.delete(:headers) || {}
42
41
  request(
43
42
  :post,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'crawl_request_id' missing" unless arguments[:crawl_request_id]
37
37
 
38
38
  crawl_request_id = arguments.delete(:crawl_request_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :get,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'domain_id' missing" unless arguments[:domain_id]
37
37
 
38
38
  domain_id = arguments.delete(:domain_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :get,
@@ -33,7 +33,6 @@ module Elastic
33
33
  #
34
34
  def crawler_domain_validation_result(arguments = {})
35
35
  body = arguments.delete(:body) || {}
36
-
37
36
  headers = arguments.delete(:headers) || {}
38
37
  request(
39
38
  :post,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'process_crawl_id' missing" unless arguments[:process_crawl_id]
37
37
 
38
38
  process_crawl_id = arguments.delete(:process_crawl_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :get,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'process_crawl_id' missing" unless arguments[:process_crawl_id]
37
37
 
38
38
  process_crawl_id = arguments.delete(:process_crawl_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :get,
@@ -30,13 +30,12 @@ module Elastic
30
30
  # @option body [string] :url *Required*
31
31
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
32
32
  #
33
- # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html
33
+ # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-post-crawler-extract-url
34
34
  #
35
35
  def crawler_url_extraction_result(engine_name, arguments = {})
36
36
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
37
37
 
38
38
  body = arguments.delete(:body) || {}
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :post,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
37
37
 
38
38
  body = arguments.delete(:body) || {}
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :post,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
37
37
 
38
38
  body = arguments.delete(:body) || {}
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :post,
@@ -41,7 +41,6 @@ module Elastic
41
41
  raise ArgumentError, "Required parameter 'body (name,type)' missing" unless arguments[:body]
42
42
 
43
43
  body = arguments.delete(:body) || {}
44
-
45
44
  headers = arguments.delete(:headers) || {}
46
45
  request(
47
46
  :post,
@@ -28,6 +28,7 @@ module Elastic
28
28
  # @param [Hash] arguments endpoint arguments
29
29
  # @option arguments [Hash] :body
30
30
  # @option body [integer] :max_crawl_depth
31
+ # @option body [boolean] :sitemap_discovery_disabled
31
32
  # @option body [Array<string>] :domain_allowlist
32
33
  # @option body [Array<string>] :seed_urls
33
34
  # @option body [Array<string>] :sitemap_urls
@@ -39,7 +40,6 @@ module Elastic
39
40
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
40
41
 
41
42
  body = arguments.delete(:body) || {}
42
-
43
43
  headers = arguments.delete(:headers) || {}
44
44
  request(
45
45
  :post,
@@ -45,7 +45,6 @@ module Elastic
45
45
 
46
46
  domain_id = arguments.delete(:domain_id)
47
47
  body = arguments.delete(:body) || {}
48
-
49
48
  headers = arguments.delete(:headers) || {}
50
49
  request(
51
50
  :post,
@@ -39,7 +39,6 @@ module Elastic
39
39
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
40
40
 
41
41
  body = arguments.delete(:body) || {}
42
-
43
42
  headers = arguments.delete(:headers) || {}
44
43
  request(
45
44
  :post,
@@ -42,7 +42,6 @@ module Elastic
42
42
 
43
43
  domain_id = arguments.delete(:domain_id)
44
44
  body = arguments.delete(:body) || {}
45
-
46
45
  headers = arguments.delete(:headers) || {}
47
46
  request(
48
47
  :post,
@@ -37,7 +37,6 @@ module Elastic
37
37
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
38
38
 
39
39
  body = arguments.delete(:body) || {}
40
-
41
40
  headers = arguments.delete(:headers) || {}
42
41
  request(
43
42
  :post,
@@ -42,7 +42,6 @@ module Elastic
42
42
 
43
43
  domain_id = arguments.delete(:domain_id)
44
44
  body = arguments.delete(:body) || {}
45
-
46
45
  headers = arguments.delete(:headers) || {}
47
46
  request(
48
47
  :post,
@@ -41,7 +41,6 @@ module Elastic
41
41
  raise ArgumentError, "Required parameter 'body (queries)' missing" unless arguments[:body]
42
42
 
43
43
  body = arguments.delete(:body) || {}
44
-
45
44
  headers = arguments.delete(:headers) || {}
46
45
  request(
47
46
  :post,
@@ -40,7 +40,6 @@ module Elastic
40
40
  raise ArgumentError, "Required parameter 'body (name)' missing" unless arguments[:body]
41
41
 
42
42
  body = arguments.delete(:body) || {}
43
-
44
43
  headers = arguments.delete(:headers) || {}
45
44
  request(
46
45
  :post,
@@ -38,7 +38,6 @@ module Elastic
38
38
  raise ArgumentError, "Required parameter 'body (synonyms)' missing" unless arguments[:body]
39
39
 
40
40
  body = arguments.delete(:body) || {}
41
-
42
41
  headers = arguments.delete(:headers) || {}
43
42
  request(
44
43
  :post,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'curation_id' missing" unless arguments[:curation_id]
37
37
 
38
38
  curation_id = arguments.delete(:curation_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :get,
@@ -34,7 +34,6 @@ module Elastic
34
34
  raise ArgumentError, "Required parameter 'api_key_name' missing" unless arguments[:api_key_name]
35
35
 
36
36
  api_key_name = arguments.delete(:api_key_name)
37
-
38
37
  headers = arguments.delete(:headers) || {}
39
38
  request(
40
39
  :delete,
@@ -39,7 +39,6 @@ module Elastic
39
39
 
40
40
  domain_id = arguments.delete(:domain_id)
41
41
  crawl_rule_id = arguments.delete(:crawl_rule_id)
42
-
43
42
  headers = arguments.delete(:headers) || {}
44
43
  request(
45
44
  :delete,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'domain_id' missing" unless arguments[:domain_id]
37
37
 
38
38
  domain_id = arguments.delete(:domain_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :delete,
@@ -39,7 +39,6 @@ module Elastic
39
39
 
40
40
  domain_id = arguments.delete(:domain_id)
41
41
  entry_point_id = arguments.delete(:entry_point_id)
42
-
43
42
  headers = arguments.delete(:headers) || {}
44
43
  request(
45
44
  :delete,
@@ -39,7 +39,6 @@ module Elastic
39
39
 
40
40
  domain_id = arguments.delete(:domain_id)
41
41
  sitemap_id = arguments.delete(:sitemap_id)
42
-
43
42
  headers = arguments.delete(:headers) || {}
44
43
  request(
45
44
  :delete,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'curation_id' missing" unless arguments[:curation_id]
37
37
 
38
38
  curation_id = arguments.delete(:curation_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :delete,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  document_ids = arguments.delete(:document_ids) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :delete,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  source_engines = arguments.delete(:source_engines) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :delete,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id]
37
37
 
38
38
  synonym_set_id = arguments.delete(:synonym_set_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :delete,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
37
37
 
38
38
  document_ids = arguments.delete(:document_ids) || {}
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :get,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  documents = arguments.delete(:documents) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :post,
@@ -37,7 +37,6 @@ module Elastic
37
37
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
38
38
 
39
39
  body = arguments.delete(:body) || {}
40
-
41
40
  headers = arguments.delete(:headers) || {}
42
41
  request(
43
42
  :post,
@@ -40,7 +40,6 @@ module Elastic
40
40
  raise ArgumentError, "Required parameter 'body (query,document_id)' missing" unless arguments[:body]
41
41
 
42
42
  body = arguments.delete(:body) || {}
43
-
44
43
  headers = arguments.delete(:headers) || {}
45
44
  request(
46
45
  :post,
@@ -37,7 +37,6 @@ module Elastic
37
37
  raise ArgumentError, "Required parameter 'body (curation)' missing" unless arguments[:body]
38
38
 
39
39
  body = arguments.delete(:body) || {}
40
-
41
40
  headers = arguments.delete(:headers) || {}
42
41
  request(
43
42
  :put,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  body = arguments.delete(:body) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :put,
@@ -44,7 +44,6 @@ module Elastic
44
44
 
45
45
  api_key_name = arguments.delete(:api_key_name)
46
46
  body = arguments.delete(:body) || {}
47
-
48
47
  headers = arguments.delete(:headers) || {}
49
48
  request(
50
49
  :put,
@@ -48,7 +48,6 @@ module Elastic
48
48
  domain_id = arguments.delete(:domain_id)
49
49
  crawl_rule_id = arguments.delete(:crawl_rule_id)
50
50
  body = arguments.delete(:body) || {}
51
-
52
51
  headers = arguments.delete(:headers) || {}
53
52
  request(
54
53
  :put,
@@ -38,7 +38,6 @@ module Elastic
38
38
  raise ArgumentError, "Required parameter 'body (frequency,unit)' missing" unless arguments[:body]
39
39
 
40
40
  body = arguments.delete(:body) || {}
41
-
42
41
  headers = arguments.delete(:headers) || {}
43
42
  request(
44
43
  :put,
@@ -42,7 +42,6 @@ module Elastic
42
42
 
43
43
  domain_id = arguments.delete(:domain_id)
44
44
  body = arguments.delete(:body) || {}
45
-
46
45
  headers = arguments.delete(:headers) || {}
47
46
  request(
48
47
  :put,
@@ -45,7 +45,6 @@ module Elastic
45
45
  domain_id = arguments.delete(:domain_id)
46
46
  entry_point_id = arguments.delete(:entry_point_id)
47
47
  body = arguments.delete(:body) || {}
48
-
49
48
  headers = arguments.delete(:headers) || {}
50
49
  request(
51
50
  :put,
@@ -45,7 +45,6 @@ module Elastic
45
45
  domain_id = arguments.delete(:domain_id)
46
46
  sitemap_id = arguments.delete(:sitemap_id)
47
47
  body = arguments.delete(:body) || {}
48
-
49
48
  headers = arguments.delete(:headers) || {}
50
49
  request(
51
50
  :put,
@@ -44,7 +44,6 @@ module Elastic
44
44
 
45
45
  curation_id = arguments.delete(:curation_id)
46
46
  body = arguments.delete(:body) || {}
47
-
48
47
  headers = arguments.delete(:headers) || {}
49
48
  request(
50
49
  :put,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  documents = arguments.delete(:documents) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :patch,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  schema = arguments.delete(:schema) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :post,
@@ -39,7 +39,6 @@ module Elastic
39
39
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
40
40
 
41
41
  body = arguments.delete(:body) || {}
42
-
43
42
  headers = arguments.delete(:headers) || {}
44
43
  request(
45
44
  :put,
@@ -41,7 +41,6 @@ module Elastic
41
41
 
42
42
  synonym_set_id = arguments.delete(:synonym_set_id)
43
43
  body = arguments.delete(:body) || {}
44
-
45
44
  headers = arguments.delete(:headers) || {}
46
45
  request(
47
46
  :put,
@@ -38,7 +38,6 @@ module Elastic
38
38
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
39
39
 
40
40
  body = arguments.delete(:body) || {}
41
-
42
41
  headers = arguments.delete(:headers) || {}
43
42
  request(
44
43
  :post,
@@ -40,7 +40,6 @@ module Elastic
40
40
  end
41
41
 
42
42
  adaptive_relevance_suggestion_type = arguments.delete(:adaptive_relevance_suggestion_type)
43
-
44
43
  headers = arguments.delete(:headers) || {}
45
44
  request(
46
45
  :post,
@@ -46,7 +46,6 @@ module Elastic
46
46
  raise ArgumentError, "Required parameter 'body (query)' missing" unless arguments[:body]
47
47
 
48
48
  body = arguments.delete(:body) || {}
49
-
50
49
  headers = arguments.delete(:headers) || {}
51
50
  request(
52
51
  :post,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id]
37
37
 
38
38
  synonym_set_id = arguments.delete(:synonym_set_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :get,
@@ -38,7 +38,6 @@ module Elastic
38
38
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
39
39
 
40
40
  body = arguments.delete(:body) || {}
41
-
42
41
  headers = arguments.delete(:headers) || {}
43
42
  request(
44
43
  :post,
@@ -37,7 +37,6 @@ module Elastic
37
37
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
38
38
 
39
39
  body = arguments.delete(:body) || {}
40
-
41
40
  headers = arguments.delete(:headers) || {}
42
41
  request(
43
42
  :post,
@@ -34,7 +34,6 @@ module Elastic
34
34
  raise ArgumentError, "Required parameter 'body (enabled)' missing" unless arguments[:body]
35
35
 
36
36
  body = arguments.delete(:body) || {}
37
-
38
37
  headers = arguments.delete(:headers) || {}
39
38
  request(
40
39
  :put,
@@ -58,6 +58,8 @@ module Elastic
58
58
  # @option options [String] :proxy url of proxy to use, ex: "http://localhost:8888"
59
59
  # @option options [Boolean] :log Use the default logger (disabled by default)
60
60
  # @option arguments [Object] :logger An instance of a Logger-compatible object
61
+ # @option arguments [Boolean] :trace Use the default tracer (disabled by default)
62
+ # @option arguments [Object] :tracer An instance of a Logger-compatible object
61
63
  # @option arguments [Symbol] :adapter A specific adapter for Faraday (e.g. `:patron`)
62
64
  # @option enable_meta_header [Boolean] :enable_meta_header Enable sending the meta data header to Cloud.
63
65
  # (Default: true)
@@ -77,7 +79,9 @@ module Elastic
77
79
  transport_options: {
78
80
  request: { open_timeout: open_timeout }
79
81
  },
80
- enable_meta_header: @options[:enable_meta_header] || true
82
+ enable_meta_header: @options[:enable_meta_header] || true,
83
+ trace: trace,
84
+ tracer: tracer
81
85
  )
82
86
  end
83
87
 
@@ -109,6 +113,14 @@ module Elastic
109
113
  @options[:adapter]
110
114
  end
111
115
 
116
+ def tracer
117
+ @options[:tracer]
118
+ end
119
+
120
+ def trace
121
+ @options[:trace]
122
+ end
123
+
112
124
  def host
113
125
  return DEFAULT_HOST unless @options[:host]
114
126
 
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
- VERSION = '8.0.0'
22
+ VERSION = '8.1.1'
23
23
  end
24
24
  end
@@ -27,12 +27,17 @@ module Elastic
27
27
  include Elastic::EnterpriseSearch::WorkplaceSearch::Actions
28
28
  include Elastic::EnterpriseSearch::Utils
29
29
 
30
+ attr_accessor :kibana_url
31
+
30
32
  # Create a new Elastic::EnterpriseSearch::WorkplaceSearch::Client client
31
33
  #
32
34
  # @param options [Hash] a hash of configuration options
33
35
  # @option options [String] :access_token the access token for workplace search
34
36
  # @option options [String] :endpoint the endpoint Workplace Search
37
+ # @option options [String] :kibana_url The base URL of your Kibana instance
38
+ #
35
39
  def initialize(options = {})
40
+ @kibana_url = options[:kibana_url]
36
41
  super(options)
37
42
  end
38
43
 
@@ -45,9 +50,11 @@ module Elastic
45
50
  end
46
51
 
47
52
  def authorization_url(client_id, redirect_uri)
53
+ raise ArgumentError, 'kibana_url The base URL of your Kibana instance must be set in the client' unless kibana_url
54
+
48
55
  [
49
- host,
50
- '/ws/oauth/authorize?',
56
+ kibana_url,
57
+ '/app/enterprise_search/workplace_search/p/oauth/authorize?',
51
58
  'response_type=code&',
52
59
  "client_id=#{client_id}&",
53
60
  "redirect_uri=#{CGI.escape(redirect_uri)}"
@@ -91,10 +91,18 @@ describe Elastic::EnterpriseSearch::WorkplaceSearch::Client do
91
91
  context 'OAuth' do
92
92
  let(:client) { Elastic::EnterpriseSearch::WorkplaceSearch::Client.new(host: host) }
93
93
 
94
- it 'generates an authorization url' do
95
- authorization_url = 'http://localhost:3002/ws/oauth/authorize?response_type=code&client_id=client_id&redirect_uri=https%3A%2F%2Flocalhost%3A3002'
94
+ it 'generates an authorization url when kibana url has been set' do
95
+ client.kibana_url = 'http://localhost:5601'
96
+ authorization_url = "#{client.kibana_url}/app/enterprise_search/workplace_search/p/oauth/authorize?" \
97
+ 'response_type=code&client_id=client_id&redirect_uri=https%3A%2F%2Flocalhost%3A3002'
96
98
  expect(client.authorization_url('client_id', 'https://localhost:3002')).to eq authorization_url
97
99
  end
100
+
101
+ it 'raises an error when kibana url is not set' do
102
+ expect do
103
+ client.authorization_url('client_id', 'https://localhost:3002')
104
+ end.to raise_exception(ArgumentError)
105
+ end
98
106
  end
99
107
 
100
108
  context 'adapters' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-enterprise-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.0
4
+ version: 8.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Briano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-11 00:00:00.000000000 Z
11
+ date: 2022-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: elastic-transport
@@ -164,8 +164,6 @@ 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.13.yml"
168
- - ".ci/jobs/elastic+enterprise-search-ruby+7.14.yml"
169
167
  - ".ci/jobs/elastic+enterprise-search-ruby+7.15.yml"
170
168
  - ".ci/jobs/elastic+enterprise-search-ruby+7.16.yml"
171
169
  - ".ci/jobs/elastic+enterprise-search-ruby+main.yml"
@@ -208,6 +206,7 @@ files:
208
206
  - docs/guide/release_notes/716.asciidoc
209
207
  - docs/guide/release_notes/717.asciidoc
210
208
  - docs/guide/release_notes/80.asciidoc
209
+ - docs/guide/release_notes/81.asciidoc
211
210
  - docs/guide/release_notes/index.asciidoc
212
211
  - docs/guide/workplace-search-api.asciidoc
213
212
  - elastic-enterprise-search.gemspec
@@ -415,7 +414,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
415
414
  - !ruby/object:Gem::Version
416
415
  version: '0'
417
416
  requirements: []
418
- rubygems_version: 3.3.3
417
+ rubygems_version: 3.3.7
419
418
  signing_key:
420
419
  specification_version: 4
421
420
  summary: Official API client for Elastic Enterprise Search
@@ -1,12 +0,0 @@
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 (&lt;branchName&gt;, &lt;tagName&gt;,
12
- &lt;commitId&gt;, etc.)
@@ -1,12 +0,0 @@
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 (&lt;branchName&gt;, &lt;tagName&gt;,
12
- &lt;commitId&gt;, etc.)