elastic-enterprise-search 7.12.1 → 7.14.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/jobs/elastic+enterprise-search-ruby+7.10.0.beta.1.yml +12 -0
  3. data/.ci/jobs/{elastic+enterprise-search-ruby+7.11.yml → elastic+enterprise-search-ruby+main.yml} +4 -4
  4. data/.ci/make.sh +162 -0
  5. data/.ci/test-matrix.yml +1 -1
  6. data/.github/check_license_headers.rb +33 -0
  7. data/.github/compatibility/Gemfile +23 -0
  8. data/.github/license-header.txt +16 -0
  9. data/.github/workflows/compatibility.yml +20 -0
  10. data/.github/workflows/license.yml +13 -0
  11. data/.github/workflows/testing.yml +1 -1
  12. data/CONTRIBUTING.md +1 -1
  13. data/README.md +1 -1
  14. data/Rakefile +1 -0
  15. data/docs/guide/app-search-api.asciidoc +28 -0
  16. data/docs/guide/connecting.asciidoc +47 -1
  17. data/docs/guide/overview.asciidoc +3 -3
  18. data/docs/guide/release_notes/712.asciidoc +0 -10
  19. data/docs/guide/release_notes/713.asciidoc +21 -0
  20. data/docs/guide/release_notes/714.asciidoc +33 -0
  21. data/docs/guide/release_notes/index.asciidoc +4 -0
  22. data/docs/guide/workplace-search-api.asciidoc +101 -2
  23. data/elastic-enterprise-search.gemspec +1 -1
  24. data/lib/elastic/app-search/api/api_key.rb +51 -0
  25. data/lib/elastic/app-search/api/create_api_key.rb +49 -0
  26. data/lib/elastic/app-search/api/delete_api_key.rb +51 -0
  27. data/lib/elastic/app-search/api/list_api_keys.rb +49 -0
  28. data/lib/elastic/app-search/api/put_api_key.rb +52 -0
  29. data/lib/elastic/enterprise-search/api/put_read_only.rb +2 -0
  30. data/lib/elastic/enterprise-search/client.rb +12 -17
  31. data/lib/elastic/enterprise-search/request.rb +5 -3
  32. data/lib/elastic/enterprise-search/version.rb +1 -1
  33. data/lib/elastic/enterprise_search.rb +11 -0
  34. data/lib/elastic/workplace-search/api/command_sync_jobs.rb +53 -0
  35. data/lib/elastic/workplace-search/api/content_source.rb +49 -0
  36. data/lib/elastic/workplace-search/api/create_analytics_event.rb +8 -8
  37. data/lib/elastic/workplace-search/api/create_batch_synonym_sets.rb +50 -0
  38. data/lib/elastic/workplace-search/api/create_content_source.rb +54 -0
  39. data/lib/elastic/workplace-search/api/create_external_identity.rb +3 -1
  40. data/lib/elastic/workplace-search/api/current_user.rb +47 -0
  41. data/lib/elastic/workplace-search/api/delete_all_documents.rb +49 -0
  42. data/lib/elastic/workplace-search/api/delete_content_source.rb +49 -0
  43. data/lib/elastic/workplace-search/api/delete_documents.rb +1 -1
  44. data/lib/elastic/workplace-search/api/delete_documents_by_query.rb +50 -0
  45. data/lib/elastic/workplace-search/api/delete_synonym_set.rb +51 -0
  46. data/lib/elastic/workplace-search/api/document.rb +53 -0
  47. data/lib/elastic/workplace-search/api/list_content_sources.rb +48 -0
  48. data/lib/elastic/workplace-search/api/list_synonym_sets.rb +51 -0
  49. data/lib/elastic/workplace-search/api/put_content_source.rb +57 -0
  50. data/lib/elastic/workplace-search/api/put_content_source_icons.rb +53 -0
  51. data/lib/elastic/workplace-search/api/put_external_identity.rb +3 -1
  52. data/lib/elastic/workplace-search/api/put_synonym_set.rb +53 -0
  53. data/lib/elastic/workplace-search/api/search.rb +1 -1
  54. data/lib/elastic/workplace-search/api/synonym_set.rb +51 -0
  55. data/lib/elastic/workplace-search/workplace_search.rb +6 -1
  56. data/rake_tasks/unified_release_tasks.rake +46 -0
  57. data/spec/app-search/api_apikey_spec.rb +92 -0
  58. data/spec/app-search/api_spec_helper.rb +16 -0
  59. data/spec/enterprise-search/client_spec.rb +0 -1
  60. data/spec/enterprise-search/request_spec.rb +26 -0
  61. data/spec/fixtures/vcr/app_search/create_api_key.yml +52 -0
  62. data/spec/fixtures/vcr/{workplace_search/delete_external_identity.yml → app_search/delete_api_key.yml} +16 -17
  63. data/spec/fixtures/vcr/{workplace_search/list_permissions.yml → app_search/get_api_key.yml} +16 -17
  64. data/spec/fixtures/vcr/app_search/list_api_keys.yml +52 -0
  65. data/spec/fixtures/vcr/app_search/put_api_key.yml +52 -0
  66. data/spec/integration/enterprise_search_api_spec.rb +4 -0
  67. data/spec/integration/icon.png +0 -0
  68. data/spec/integration/workplace_search_spec.rb +375 -0
  69. data/spec/webmock_requires.rb +16 -0
  70. data/spec/workplace-search/client_spec.rb +24 -2
  71. metadata +43 -27
  72. data/.ci/jobs/elastic+enterprise-search-ruby+master.yml +0 -12
  73. data/spec/fixtures/vcr/workplace_search/add_user_permissions.yml +0 -53
  74. data/spec/fixtures/vcr/workplace_search/clear_user_permissions.yml +0 -53
  75. data/spec/fixtures/vcr/workplace_search/create_external_identity.yml +0 -53
  76. data/spec/fixtures/vcr/workplace_search/delete_documents.yml +0 -53
  77. data/spec/fixtures/vcr/workplace_search/index_documents.yml +0 -55
  78. data/spec/fixtures/vcr/workplace_search/list_external_identities.yml +0 -53
  79. data/spec/fixtures/vcr/workplace_search/put_external_identity.yml +0 -53
  80. data/spec/fixtures/vcr/workplace_search/put_user_permissions.yml +0 -103
  81. data/spec/fixtures/vcr/workplace_search/remove_user_permissions.yml +0 -53
  82. data/spec/fixtures/vcr/workplace_search/retrieve_external_identity.yml +0 -53
  83. data/spec/fixtures/vcr/workplace_search/user_permissions_empty.yml +0 -53
  84. data/spec/workplace-search/documents_spec.rb +0 -80
  85. data/spec/workplace-search/external_identities_spec.rb +0 -84
  86. data/spec/workplace-search/permissions_spec.rb +0 -136
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cc91758d4ef25ab3d509996223bf7c7cb07352e81f5f450fccadf8e0d799a4b
4
- data.tar.gz: 646f6a1cb4295263a1dc3ee07441aa8c5bfe20b1692e5f0d970d31a2a14a41c4
3
+ metadata.gz: 862dd17061e11215dd63c1be695e9757f06acc7f09ef6fc0d55719dcd174f213
4
+ data.tar.gz: 3ebefa23f22d0a4cb002d9ad533d88810ba3ed2053028c7678487a7e478cf4f8
5
5
  SHA512:
6
- metadata.gz: bddacbdbf0df0b8fe15197e4b3a016743dc7a79854d1de1bc9b5216c6297051808d905daae04c7d1da949840f971b4ad65dfc95b258db063a985380eaa66109c
7
- data.tar.gz: 45e7a164a0ee32daa8968b87690c27eead9b3de83e5ae4e72fb7a9d6a496cd2fa4ec24dd696f666ac581c19d541e4cc978423f0b888f6611329b8c351b9408ed
6
+ metadata.gz: f1b0a6cce0c8e8615ee8bd4dba0c8e339b76c8870831fc19f494c9d976b0f8f4529a80fb735201995f0f09b9f70c0f5ae6a47e88a5ca5171fb9515d401d1d3c7
7
+ data.tar.gz: 1fcb83403aaaf344fabe4363573022ddcd0156b6095eef6759e58bbf2592df279251df96065b7ff80cdca193a4e08cef1247827ad4ca9ca42dc96e81cd6b7d5b
@@ -0,0 +1,12 @@
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,12 +1,12 @@
1
1
  ---
2
2
  - job:
3
- name: elastic+enterprise-search-ruby+7.11
4
- display-name: 'elastic / enterprise-search-ruby # 7.11'
5
- description: Testing the enterprise-search-ruby 7.11 branch.
3
+ name: elastic+enterprise-search-ruby+main
4
+ display-name: 'elastic / enterprise-search-ruby # main'
5
+ description: Testing the enterprise-search-ruby main branch.
6
6
  junit_results: "*-junit.xml"
7
7
  parameters:
8
8
  - string:
9
9
  name: branch_specifier
10
- default: refs/heads/7.11
10
+ default: refs/heads/main
11
11
  description: the Git branch specifier to build (<branchName>, <tagName>,
12
12
  <commitId>, etc.)
data/.ci/make.sh ADDED
@@ -0,0 +1,162 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # ------------------------------------------------------- #
4
+ #
5
+ # Skeleton for common build entry script for all elastic
6
+ # clients. Needs to be adapted to individual client usage.
7
+ #
8
+ # Must be called: ./.ci/make.sh <target> <params>
9
+ #
10
+ # Version: 1.1.0
11
+ #
12
+ # Targets:
13
+ # ---------------------------
14
+ # assemble <VERSION> : build client artefacts with version
15
+ # bump <VERSION> : bump client internals to version
16
+ # codegen <VERSION> : generate endpoints
17
+ # docsgen <VERSION> : generate documentation
18
+ # examplegen : generate the doc examples
19
+ # clean : clean workspace
20
+ #
21
+ # ------------------------------------------------------- #
22
+
23
+ # ------------------------------------------------------- #
24
+ # Bootstrap
25
+ # ------------------------------------------------------- #
26
+
27
+ script_path=$(dirname "$(realpath -s "$0")")
28
+ repo=$(realpath "$script_path/../")
29
+
30
+ # shellcheck disable=SC1090
31
+ CMD=$1
32
+ TASK=$1
33
+ TASK_ARGS=()
34
+ VERSION=$2
35
+ STACK_VERSION=$VERSION
36
+ set -euo pipefail
37
+
38
+ product="elastic/enterprise-search-ruby"
39
+ output_folder=".ci/output"
40
+ codegen_folder=".ci/output"
41
+ OUTPUT_DIR="$repo/${output_folder}"
42
+ REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
43
+ mkdir -p "$OUTPUT_DIR"
44
+
45
+ echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m"
46
+ echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
47
+ echo -e "\033[34;1mINFO:\033[0m OUTPUT_DIR ${OUTPUT_DIR}\033[0m"
48
+
49
+ RUBY_TEST_VERSION=${RUBY_TEST_VERSION-2.7}
50
+
51
+ case $CMD in
52
+ clean)
53
+ echo -e "\033[36;1mTARGET: clean workspace $output_folder\033[0m"
54
+ rm -rf "$output_folder"
55
+ echo -e "\033[32;1mdone.\033[0m"
56
+ exit 0
57
+ ;;
58
+ assemble)
59
+ if [ -v $VERSION ]; then
60
+ echo -e "\033[31;1mTARGET: assemble -> missing version parameter\033[0m"
61
+ exit 1
62
+ fi
63
+ echo -e "\033[36;1mTARGET: assemble artefact $VERSION\033[0m"
64
+ TASK=assemble
65
+ TASK_ARGS=("$VERSION" "$output_folder")
66
+ ;;
67
+ codegen)
68
+ if [ -v $VERSION ]; then
69
+ echo -e "\033[31;1mTARGET: codegen -> missing version parameter\033[0m"
70
+ exit 1
71
+ fi
72
+ echo -e "\033[36;1mTARGET: codegen API v$VERSION\033[0m"
73
+ TASK=codegen
74
+ # VERSION is BRANCH here for now
75
+ TASK_ARGS=("$VERSION" "$codegen_folder")
76
+ ;;
77
+ docsgen)
78
+ if [ -v $VERSION ]; then
79
+ echo -e "\033[31;1mTARGET: docsgen -> missing version parameter\033[0m"
80
+ exit 1
81
+ fi
82
+ echo -e "\033[36;1mTARGET: generate docs for $VERSION\033[0m"
83
+ TASK=codegen
84
+ # VERSION is BRANCH here for now
85
+ TASK_ARGS=("$VERSION" "$codegen_folder")
86
+ ;;
87
+ examplesgen)
88
+ echo -e "\033[36;1mTARGET: generate examples\033[0m"
89
+ TASK=codegen
90
+ # VERSION is BRANCH here for now
91
+ TASK_ARGS=("$VERSION" "$codegen_folder")
92
+ ;;
93
+ bump)
94
+ if [ -v $VERSION ]; then
95
+ echo -e "\033[31;1mTARGET: bump -> missing version parameter\033[0m"
96
+ exit 1
97
+ fi
98
+ echo -e "\033[36;1mTARGET: bump to version $VERSION\033[0m"
99
+ TASK=bump
100
+ # VERSION is BRANCH here for now
101
+ TASK_ARGS=("$VERSION")
102
+ ;;
103
+ *)
104
+ echo -e "\nUsage:\n\t $CMD is not supported right now\n"
105
+ exit 1
106
+ esac
107
+
108
+
109
+ # ------------------------------------------------------- #
110
+ # Build Container
111
+ # ------------------------------------------------------- #
112
+
113
+ echo -e "\033[34;1mINFO: building $product container\033[0m"
114
+
115
+ docker build --file .ci/Dockerfile --tag ${product} \
116
+ --build-arg USER_ID="$(id -u)" \
117
+ --build-arg GROUP_ID="$(id -g)" .
118
+
119
+
120
+ # ------------------------------------------------------- #
121
+ # Run the Container
122
+ # ------------------------------------------------------- #
123
+
124
+ echo -e "\033[34;1mINFO: running $product container\033[0m"
125
+
126
+ # Convert ARGS to comma separated string for Rake:
127
+ args_string="${TASK_ARGS[*]}"
128
+ args_string="${args_string// /,}"
129
+
130
+ docker run \
131
+ --env "RUBY_TEST_VERSION=${RUBY_TEST_VERSION}" \
132
+ --name test-runner \
133
+ --volume $REPO_BINDING \
134
+ --volume $repo:/usr/src/app \
135
+ --rm \
136
+ $product \
137
+ bundle exec rake unified_release:"$TASK"["$args_string"]
138
+
139
+ # ------------------------------------------------------- #
140
+ # Post Command tasks & checks
141
+ # ------------------------------------------------------- #
142
+
143
+ if [[ "$CMD" == "assemble" ]]; then
144
+ if compgen -G ".ci/output/*" > /dev/null; then
145
+ echo -e "\033[32;1mTARGET: successfully assembled client v$VERSION\033[0m"
146
+ else
147
+ echo -e "\033[31;1mTARGET: assemble failed, empty workspace!\033[0m"
148
+ exit 1
149
+ fi
150
+ fi
151
+
152
+ if [[ "$CMD" == "codegen" ]]; then
153
+ echo "TODO"
154
+ fi
155
+
156
+ if [[ "$CMD" == "docsgen" ]]; then
157
+ echo "TODO"
158
+ fi
159
+
160
+ if [[ "$CMD" == "examplesgen" ]]; then
161
+ echo "TODO"
162
+ fi
data/.ci/test-matrix.yml CHANGED
@@ -6,7 +6,7 @@ RUBY_VERSION:
6
6
  - 2.5
7
7
 
8
8
  STACK_VERSION:
9
- - 7.12-SNAPSHOT
9
+ - 7.14-SNAPSHOT
10
10
 
11
11
  TEST_SUITE:
12
12
  - platinum
@@ -0,0 +1,33 @@
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
+ LICENSE = File.read('./.github/license-header.txt')
19
+ files = `git ls-files | grep -E '\.rb|Rakefile|\.rake|\.erb|Gemfile|gemspec'`.split("\n")
20
+ errors = []
21
+
22
+ files.each do |file|
23
+ unless File.read(file).include?(LICENSE)
24
+ errors << file
25
+ puts "#{file} doesn't contain the correct license header"
26
+ end
27
+ end
28
+
29
+ if errors.empty?
30
+ puts 'All checked files have the correct license header'
31
+ else
32
+ exit 1
33
+ end
@@ -0,0 +1,23 @@
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__)
@@ -0,0 +1,16 @@
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.
@@ -0,0 +1,20 @@
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
@@ -0,0 +1,13 @@
1
+ name: License headers
2
+ on: [pull_request]
3
+ jobs:
4
+ build:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - uses: actions/checkout@v2
8
+ - uses: ruby/setup-ruby@v1
9
+ with:
10
+ ruby-version: 3
11
+ - name: Check license headers
12
+ run: |
13
+ ruby ./.github/check_license_headers.rb
@@ -1,4 +1,4 @@
1
- name: master
1
+ name: 7.14
2
2
  on: [push, pull_request]
3
3
 
4
4
  jobs:
data/CONTRIBUTING.md CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  3. Rebase your changes. Update your local repository with the most recent code
24
24
  from the main `enterprise-search-ruby` repository and rebase your branch
25
- on top of the latest `master` branch. All of your changes will be squashed
25
+ on top of the latest `main` branch. All of your changes will be squashed
26
26
  into a single commit so don't worry about pushing multiple times.
27
27
 
28
28
  4. Submit a pull request. Push your local changes to your forked repository
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Elastic Enterprise Search Client
2
2
 
3
- ![build](https://github.com/elastic/enterprise-search-ruby/workflows/master/badge.svg)
3
+ ![build](https://github.com/elastic/enterprise-search-ruby/workflows/main/badge.svg)
4
4
  ![rubocop](https://github.com/elastic/enterprise-search-ruby/workflows/rubocop/badge.svg)
5
5
  [![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop-hq/rubocop)
6
6
 
data/Rakefile CHANGED
@@ -19,6 +19,7 @@
19
19
 
20
20
  require 'rspec/core/rake_task'
21
21
  require 'bundler/gem_tasks'
22
+ import 'rake_tasks/unified_release_tasks.rake'
22
23
 
23
24
  desc 'Open an irb session preloaded with this library'
24
25
  task :console do
@@ -146,6 +146,34 @@ client.list_curations(engine_name)
146
146
  client.delete_curation(engine_name, curation_id: 'cur-id')
147
147
  ----------------------------
148
148
 
149
+ === Api Key
150
+
151
+ [source,rb]
152
+ ----------------------------
153
+ # Create API Key
154
+ body = {
155
+ name: name,
156
+ type: 'private',
157
+ read: true,
158
+ write: true,
159
+ access_all_engines: true
160
+ }
161
+ response = client.create_api_key(body: body)
162
+
163
+ # Get the details of an API Key
164
+ client.api_key(api_key_name: name)
165
+
166
+ # List API Keys
167
+ client.list_api_keys
168
+
169
+ # Update an API Key
170
+ body = { name: name, type: 'private', read: true, write: true, engines: ['test'] }
171
+ client.put_api_key(api_key_name: name, body: body)
172
+
173
+ # Delete an API Key
174
+ client.delete_api_key(api_key_name: name)
175
+ ----------------------------
176
+
149
177
  === Other API Endpoints
150
178
 
151
179
  [source,rb]
@@ -87,7 +87,13 @@ client.search(engine_name, query: 'jungle')
87
87
  [[auth-ws]]
88
88
  ==== Authenticating with Workplace Search
89
89
 
90
- In your Elastic Workplace Search dashboard navigate to _Sources/Add a Shared Content Source_ and select _Custom API Source_ to create a new source. Name your source (e.g. `Enterprise Search Ruby Client`) and once it's created you'll get an `access token` and an `ID`. You'll need these in the following steps.
90
+ Workplace Search supports multiple authentication methods:
91
+
92
+ [discrete]
93
+ [[access-tokens]]
94
+ ===== Workplace Search admin user access tokens
95
+
96
+ In your Elastic Workplace Search dashboard navigate to _Sources/Add a Shared Content Source_ and select _Custom API Source_ to create a new source. Name your source (e.g. `Enterprise Search Ruby Client`) and once it's created you'll get an `access token` and an `ID`.
91
97
 
92
98
  The Workplace Search client can be accessed from an existing Enterprise Search Client, or you can initialize a new one. If you instantiate the Workplace Search client from an existing Enterprise Search Client, it's going to share the HTTP transport instance, so it's going to connect to the same host, which is a common scenario. However, if you want to connect to a different host, you should instantiate a new Workplace Client on its own:
93
99
 
@@ -109,6 +115,46 @@ workplace_search_client = Elastic::EnterpriseSearch::WorkplaceSearch::Client.new
109
115
  )
110
116
  ----------------------------
111
117
 
118
+ [discrete]
119
+ [[basic-auth]]
120
+ ===== Basic Authentication
121
+
122
+ Workplace Search APIs support basic authentication headers to authenticate users. All Workplace Search APIs support basic authentication:
123
+
124
+ [source,rb]
125
+ ----------------------------
126
+ host = 'https://id.ent-search.europe-west2.gcp.elastic-cloud.com'
127
+ basic_auth = { user: 'enterprise_search', password: 'changeme' }
128
+
129
+ workplace_search_client = Elastic::EnterpriseSearch::WorkplaceSearch::Client.new(
130
+ host: host,
131
+ http_auth: basic_auth
132
+ )
133
+ ----------------------------
134
+
135
+ [discrete]
136
+ [[es-tokens]]
137
+ ===== Elasticsearch tokens
138
+
139
+ Workplace Search APIs support Elasticsearch tokens generated by the Elasticsearch Token Service. All Workplace Search APIs support Elasticsearch tokens as an authentication method.
140
+
141
+ [source,rb]
142
+ ----------------------------
143
+ host = 'https://id.ent-search.europe-west2.gcp.elastic-cloud.com'
144
+ access_token = '<access token>'
145
+
146
+ workplace_search_client = Elastic::EnterpriseSearch::WorkplaceSearch::Client.new(
147
+ host: host,
148
+ http_auth: access_token
149
+ )
150
+ ----------------------------
151
+
152
+ [discrete]
153
+ [[ws-oauth]]
154
+ ===== Workplace Search OAuth access tokens
155
+
156
+ The Search API and the Analytics Events API support user access tokens generated by the Workplace Search OAuth Service. The token is acquired via an OAuth authorization flow. User access tokens are meant to be used for Custom Search Experiences. Check <<ws-oauth-authentication>>.
157
+
112
158
  [discrete]
113
159
  [[custom_headers]]
114
160
  === Custom HTTP Headers
@@ -6,7 +6,7 @@ This is the official Ruby client for Elastic Enterprise Search.
6
6
  [discrete]
7
7
  === Compatibility
8
8
 
9
- Current development happens in the master branch.
9
+ Current development happens in the main branch.
10
10
 
11
11
  The library is compatible with all Elastic Enterprise Search versions since `7.x` but you **have to use a matching major version**:
12
12
 
@@ -14,11 +14,11 @@ 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/master/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/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].
18
18
 
19
19
  All requests, if successful, will return an `Elasticsearch::Transport::Transport::Response` instance. You can access the response `body`, `headers` and `status`.
20
20
 
21
- `elasticsearch-transport` defines a https://github.com/elasticsearch/elasticsearch-ruby/blob/master/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/master/elasticsearch-transport#exception-handling[here]. You can find the full documentation for `elasticsearch-transport` at https://rubydoc.info/gems/elasticsearch-transport[RubyDoc].
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].
22
22
 
23
23
  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
24
 
@@ -26,13 +26,3 @@
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
- ----------------------------
@@ -0,0 +1,21 @@
1
+ [[release_notes_713]]
2
+ === 7.13.0 Release notes
3
+
4
+ [discrete]
5
+ ==== General
6
+
7
+ - Tested with Elastic Enterprise Search API version 7.13.0.
8
+ - Improved meta header implementation for Elastic Cloud.
9
+
10
+ [discrete]
11
+ ==== Workplace Search
12
+
13
+ * The client now supports Basic Authentication and Elasticsearch tokens. All Workplace Search APIs support Basic Authentication, Elasticsearch tokens and Workplace Search admin user access tokens as an authentication method. You still need to set up user access tokens generated by the Workplace Search OAuth Service for the Search API and the Analytics Events API.
14
+ * New APIs:
15
+ ** `document`: Retrieve a document by ID from a specified content source.
16
+ ** `delete_all_documents`: Delete all documents for a given content source
17
+ ** `content_source`: Retrieves a content source by ID
18
+ ** `create_content_source`: Creates a custom content source
19
+ ** `delete_content_source`: Deletes a content source by ID
20
+ ** `list_content_sources`: Retrieves all content sources
21
+ ** `put_content_source`: Updates a custom content source
@@ -0,0 +1,33 @@
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
+ === 7.14.0 Release notes
15
+
16
+ [discrete]
17
+ ==== General
18
+
19
+ - Tested with Elastic Enterprise Search API version 7.14.0.
20
+
21
+ [discrete]
22
+ ==== App Search
23
+
24
+ - Adds API Key endpoints: `api_key`, `create_api_key`, `delete_api_key`, `list_api_keys`, `put_api_key`
25
+
26
+ [discrete]
27
+ ==== Workplace Search
28
+
29
+ - Adds synonym set endpoints: `create_batch_synonym_sets`, `delete_synonym_set`, `list_synonym_sets`, `put_synonym_set`, `synonym_set`
30
+ - Adds `current_user` endpoint
31
+ - Adds `command_sync_jobs` endpoint
32
+ - Adds `delete_documents_by_query` endpoint
33
+ - Adds `put_content_source_icons` endpoint
@@ -5,10 +5,14 @@
5
5
  [discrete]
6
6
  === 7.x
7
7
 
8
+ * <<release_notes_714, 7.14.0 Release Notes>>
9
+ * <<release_notes_713, 7.13.0 Release Notes>>
8
10
  * <<release_notes_712, 7.12.0 Release Notes>>
9
11
  * <<release_notes_711, 7.11.0 Release Notes>>
10
12
  * <<release_notes_710, 7.10.0.beta.1 Release Notes>>
11
13
 
14
+ include::714.asciidoc[]
15
+ include::713.asciidoc[]
12
16
  include::712.asciidoc[]
13
17
  include::711.asciidoc[]
14
18
  include::710.asciidoc[]