elastic-enterprise-search 7.13.0 → 7.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ci/functions/imports.sh +1 -0
- data/.ci/jobs/defaults.yml +4 -0
- data/.ci/jobs/{elastic+enterprise-search-ruby+master.yml → elastic+enterprise-search-ruby+main.yml} +4 -4
- data/.ci/make.sh +162 -0
- data/.ci/run-repository.sh +2 -1
- data/.ci/test-matrix.yml +5 -3
- data/.github/check_license_headers.rb +33 -0
- data/{spec/app-search/api_logs_spec.rb → .github/compatibility/Gemfile} +3 -16
- data/.github/license-header.txt +16 -0
- data/.github/workflows/compatibility.yml +20 -0
- data/.github/workflows/license.yml +13 -0
- data/.github/workflows/testing.yml +1 -1
- data/CONTRIBUTING.md +1 -1
- data/README.md +1 -1
- data/Rakefile +20 -0
- data/docs/guide/app-search-api.asciidoc +157 -1
- data/docs/guide/overview.asciidoc +3 -3
- data/docs/guide/release_notes/712.asciidoc +12 -0
- data/docs/guide/release_notes/714.asciidoc +33 -0
- data/docs/guide/release_notes/715.asciidoc +48 -0
- data/docs/guide/release_notes/index.asciidoc +4 -0
- data/docs/guide/workplace-search-api.asciidoc +69 -0
- data/elastic-enterprise-search.gemspec +1 -1
- data/lib/elastic/app-search/api/add_meta_engine_source.rb +3 -2
- data/lib/elastic/app-search/api/api_key.rb +52 -0
- data/lib/elastic/app-search/api/api_logs.rb +14 -13
- data/lib/elastic/app-search/api/count_analytics.rb +7 -6
- data/lib/elastic/app-search/api/crawler_active_crawl_request.rb +51 -0
- data/lib/elastic/app-search/api/crawler_crawl_request.rb +54 -0
- data/lib/elastic/app-search/api/crawler_crawl_schedule.rb +51 -0
- data/lib/elastic/app-search/api/crawler_domain.rb +54 -0
- data/lib/elastic/app-search/api/crawler_domain_validation_result.rb +48 -0
- data/lib/elastic/app-search/api/crawler_metrics.rb +48 -0
- data/lib/elastic/app-search/api/crawler_overview.rb +51 -0
- data/lib/elastic/app-search/api/crawler_process_crawl.rb +54 -0
- data/lib/elastic/app-search/api/crawler_process_crawl_denied_urls.rb +54 -0
- data/lib/elastic/app-search/api/crawler_url_extraction_result.rb +52 -0
- data/lib/elastic/app-search/api/crawler_url_tracing_result.rb +52 -0
- data/lib/elastic/app-search/api/crawler_url_validation_result.rb +52 -0
- data/lib/elastic/app-search/api/crawler_user_agent.rb +48 -0
- data/lib/elastic/app-search/api/create_api_key.rb +57 -0
- data/lib/elastic/app-search/api/create_crawler_crawl_request.rb +51 -0
- data/lib/elastic/app-search/api/create_crawler_crawl_rule.rb +59 -0
- data/lib/elastic/app-search/api/create_crawler_domain.rb +55 -0
- data/lib/elastic/app-search/api/create_crawler_entry_point.rb +56 -0
- data/lib/elastic/app-search/api/create_crawler_process_crawl.rb +53 -0
- data/lib/elastic/app-search/api/create_crawler_sitemap.rb +56 -0
- data/lib/elastic/app-search/api/create_curation.rb +7 -6
- data/lib/elastic/app-search/api/create_engine.rb +9 -7
- data/lib/elastic/app-search/api/create_synonym_set.rb +7 -4
- data/lib/elastic/app-search/api/curation.rb +4 -3
- data/lib/elastic/app-search/api/delete_active_crawl_request.rb +51 -0
- data/lib/elastic/app-search/api/delete_api_key.rb +52 -0
- data/lib/elastic/app-search/api/delete_crawler_active_crawl_request.rb +51 -0
- data/lib/elastic/app-search/api/delete_crawler_crawl_rule.rb +57 -0
- data/lib/elastic/app-search/api/delete_crawler_crawl_schedule.rb +51 -0
- data/lib/elastic/app-search/api/delete_crawler_domain.rb +54 -0
- data/lib/elastic/app-search/api/delete_crawler_entry_point.rb +57 -0
- data/lib/elastic/app-search/api/delete_crawler_sitemap.rb +57 -0
- data/lib/elastic/app-search/api/delete_curation.rb +4 -3
- data/lib/elastic/app-search/api/delete_documents.rb +2 -1
- data/lib/elastic/app-search/api/delete_engine.rb +3 -2
- data/lib/elastic/app-search/api/delete_meta_engine_source.rb +3 -3
- data/lib/elastic/app-search/api/delete_synonym_set.rb +4 -3
- data/lib/elastic/app-search/api/denied_urls.rb +54 -0
- data/lib/elastic/app-search/api/documents.rb +3 -2
- data/lib/elastic/app-search/api/engine.rb +3 -2
- data/lib/elastic/app-search/api/index_documents.rb +3 -2
- data/lib/elastic/app-search/api/list_api_keys.rb +50 -0
- data/lib/elastic/app-search/api/list_crawler_crawl_requests.rb +52 -0
- data/lib/elastic/app-search/api/list_crawler_process_crawls.rb +51 -0
- data/lib/elastic/app-search/api/list_curations.rb +3 -2
- data/lib/elastic/app-search/api/list_documents.rb +3 -2
- data/lib/elastic/app-search/api/list_engines.rb +2 -1
- data/lib/elastic/app-search/api/list_synonym_sets.rb +3 -2
- data/lib/elastic/app-search/api/log_clickthrough.rb +8 -10
- data/lib/elastic/app-search/api/put_api_key.rb +59 -0
- data/lib/elastic/app-search/api/put_crawler_crawl_rule.rb +62 -0
- data/lib/elastic/app-search/api/put_crawler_crawl_schedule.rb +53 -0
- data/lib/elastic/app-search/api/put_crawler_domain.rb +58 -0
- data/lib/elastic/app-search/api/put_crawler_entry_point.rb +59 -0
- data/lib/elastic/app-search/api/put_crawler_sitemap.rb +59 -0
- data/lib/elastic/app-search/api/put_curation.rb +9 -8
- data/lib/elastic/app-search/api/put_documents.rb +3 -3
- data/lib/elastic/app-search/api/put_schema.rb +4 -4
- data/lib/elastic/app-search/api/put_search_settings.rb +6 -2
- data/lib/elastic/app-search/api/put_synonym_set.rb +8 -5
- data/lib/elastic/app-search/api/query_suggestion.rb +7 -7
- data/lib/elastic/app-search/api/reset_search_settings.rb +3 -2
- data/lib/elastic/app-search/api/schema.rb +3 -2
- data/lib/elastic/app-search/api/search.rb +14 -3
- data/lib/elastic/app-search/api/search_settings.rb +3 -2
- data/lib/elastic/app-search/api/synonym_set.rb +4 -3
- data/lib/elastic/app-search/api/top_clicks_analytics.rb +8 -8
- data/lib/elastic/app-search/api/top_queries_analytics.rb +7 -7
- data/lib/elastic/app-search/app_search.rb +0 -10
- data/lib/elastic/enterprise-search/api/health.rb +1 -0
- data/lib/elastic/enterprise-search/api/put_read_only.rb +3 -2
- data/lib/elastic/enterprise-search/api/read_only.rb +1 -0
- data/lib/elastic/enterprise-search/api/version.rb +1 -0
- data/lib/elastic/enterprise-search/client.rb +12 -1
- data/lib/elastic/enterprise-search/request.rb +10 -1
- data/lib/elastic/enterprise-search/version.rb +1 -1
- data/lib/elastic/workplace-search/api/auto_query_refinement_details.rb +49 -0
- data/lib/elastic/workplace-search/api/command_sync_jobs.rb +53 -0
- data/lib/elastic/workplace-search/api/create_analytics_event.rb +7 -7
- data/lib/elastic/workplace-search/api/create_batch_synonym_sets.rb +50 -0
- data/lib/elastic/workplace-search/api/create_content_source.rb +5 -2
- data/lib/elastic/workplace-search/api/create_external_identity.rb +3 -3
- data/lib/elastic/workplace-search/api/current_user.rb +47 -0
- data/lib/elastic/workplace-search/api/delete_documents_by_query.rb +50 -0
- data/lib/elastic/workplace-search/api/delete_synonym_set.rb +51 -0
- data/lib/elastic/workplace-search/api/document.rb +1 -1
- data/lib/elastic/workplace-search/api/list_synonym_sets.rb +51 -0
- data/lib/elastic/workplace-search/api/put_content_source.rb +7 -4
- data/lib/elastic/workplace-search/api/put_content_source_icons.rb +53 -0
- data/lib/elastic/workplace-search/api/put_external_identity.rb +3 -3
- data/lib/elastic/workplace-search/api/put_synonym_set.rb +53 -0
- data/lib/elastic/workplace-search/api/put_triggers_blocklist.rb +47 -0
- data/lib/elastic/workplace-search/api/search.rb +4 -1
- data/lib/elastic/workplace-search/api/synonym_set.rb +51 -0
- data/lib/elastic/workplace-search/api/triggers_blocklist.rb +45 -0
- data/lib/elastic/workplace-search/workplace_search.rb +0 -15
- data/rake_tasks/unified_release_tasks.rake +46 -0
- data/spec/integration/app-search/api_key_spec.rb +110 -0
- data/spec/integration/app-search/api_logs_spec.rb +59 -0
- data/spec/integration/app-search/app_search_helper.rb +51 -0
- data/spec/integration/app-search/count_analytics_spec.rb +47 -0
- data/spec/integration/app-search/crawl_requests_spec.rb +86 -0
- data/spec/integration/app-search/crawler_crawl_rule_spec.rb +73 -0
- data/spec/integration/app-search/crawler_domain_spec.rb +82 -0
- data/spec/integration/app-search/crawler_entry_point_spec.rb +77 -0
- data/spec/integration/app-search/crawler_metrics_spec.rb +46 -0
- data/spec/integration/app-search/crawler_overview_spec.rb +45 -0
- data/spec/integration/app-search/crawler_process_crawl_denied_urls_spec.rb +50 -0
- data/spec/integration/app-search/crawler_process_crawl_spec.rb +66 -0
- data/spec/integration/app-search/crawler_scheduling_spec.rb +69 -0
- data/spec/integration/app-search/crawler_sitemap_spec.rb +72 -0
- data/spec/integration/app-search/crawler_urls_spec.rb +60 -0
- data/spec/{app-search/api_count_analytics_spec.rb → integration/app-search/crawler_user_agent_spec.rb} +6 -9
- data/spec/integration/app-search/curations_spec.rb +118 -0
- data/spec/integration/app-search/documents_spec.rb +123 -0
- data/spec/integration/app-search/engines_spec.rb +78 -0
- data/spec/{app-search/api_log_clickthrough_spec.rb → integration/app-search/log_clickthrough_spec.rb} +14 -7
- data/spec/integration/app-search/meta_engines_spec.rb +75 -0
- data/spec/integration/app-search/query_suggestion_spec.rb +50 -0
- data/spec/{app-search/api_schema_spec.rb → integration/app-search/schema_spec.rb} +21 -16
- data/spec/integration/app-search/search_and_multiple_search_spec.rb +67 -0
- data/spec/integration/app-search/search_settings_spec.rb +87 -0
- data/spec/integration/app-search/synonyms_spec.rb +79 -0
- data/spec/{app-search/api_top_clicks_analytics_spec.rb → integration/app-search/top_clicks_analytics_spec.rb} +20 -14
- data/spec/{app-search/api_top_queries_analytics_spec.rb → integration/app-search/top_queries_analytics_spec.rb} +16 -8
- data/spec/integration/workplace-search/content_sources_spec.rb +106 -0
- data/spec/integration/workplace-search/documents_spec.rb +95 -0
- data/spec/integration/workplace-search/external_identities_spec.rb +97 -0
- data/spec/integration/workplace-search/icon.png +0 -0
- data/spec/integration/workplace-search/permissions_spec.rb +77 -0
- data/spec/integration/workplace-search/synonym_sets_spec.rb +92 -0
- data/spec/integration/workplace-search/triggers_spec.rb +43 -0
- data/spec/{app-search/api_query_suggestion_spec.rb → integration/workplace-search/users_spec.rb} +12 -15
- data/spec/integration/workplace-search/workplace_search_helper.rb +39 -0
- data/spec/webmock_requires.rb +16 -0
- metadata +105 -61
- data/spec/app-search/api_curations_spec.rb +0 -97
- data/spec/app-search/api_documents_spec.rb +0 -102
- data/spec/app-search/api_engines_spec.rb +0 -67
- data/spec/app-search/api_meta_engines_spec.rb +0 -72
- data/spec/app-search/api_search_and_multi_search_spec.rb +0 -48
- data/spec/app-search/api_search_settings_spec.rb +0 -76
- data/spec/app-search/api_spec_helper.rb +0 -14
- data/spec/app-search/api_synonyms_spec.rb +0 -79
- data/spec/fixtures/vcr/app_search/add_meta_engine_source.yml +0 -109
- data/spec/fixtures/vcr/app_search/api_documents.yml +0 -56
- data/spec/fixtures/vcr/app_search/api_index_documents.yml +0 -57
- data/spec/fixtures/vcr/app_search/api_log_clickthrough.yml +0 -54
- data/spec/fixtures/vcr/app_search/api_logs.yml +0 -70
- data/spec/fixtures/vcr/app_search/api_put_schema.yml +0 -109
- data/spec/fixtures/vcr/app_search/api_put_search_settings.yml +0 -56
- data/spec/fixtures/vcr/app_search/api_query_suggestion.yml +0 -59
- data/spec/fixtures/vcr/app_search/api_reset_search_settings.yml +0 -56
- data/spec/fixtures/vcr/app_search/api_schema.yml +0 -56
- data/spec/fixtures/vcr/app_search/api_search_settings.yml +0 -56
- data/spec/fixtures/vcr/app_search/api_top_clicks_analytics.yml +0 -55
- data/spec/fixtures/vcr/app_search/api_top_clicks_analytics_query.yml +0 -55
- data/spec/fixtures/vcr/app_search/api_top_queries_analytics.yml +0 -55
- data/spec/fixtures/vcr/app_search/count_analytics.yml +0 -55
- data/spec/fixtures/vcr/app_search/create_and_update_document.yml +0 -107
- data/spec/fixtures/vcr/app_search/create_curation.yml +0 -113
- data/spec/fixtures/vcr/app_search/create_engine.yml +0 -55
- data/spec/fixtures/vcr/app_search/create_meta_engine.yml +0 -56
- data/spec/fixtures/vcr/app_search/create_synonym_set.yml +0 -56
- data/spec/fixtures/vcr/app_search/delete_curation.yml +0 -56
- data/spec/fixtures/vcr/app_search/delete_engine.yml +0 -55
- data/spec/fixtures/vcr/app_search/delete_meta_engine_source.yml +0 -56
- data/spec/fixtures/vcr/app_search/delete_synonym_set.yml +0 -56
- data/spec/fixtures/vcr/app_search/get_curation.yml +0 -56
- data/spec/fixtures/vcr/app_search/get_engine.yml +0 -55
- data/spec/fixtures/vcr/app_search/index_and_delete_document.yml +0 -107
- data/spec/fixtures/vcr/app_search/list_curations.yml +0 -56
- data/spec/fixtures/vcr/app_search/list_documents.yml +0 -57
- data/spec/fixtures/vcr/app_search/list_engines.yml +0 -55
- data/spec/fixtures/vcr/app_search/list_synonym_sets.yml +0 -56
- data/spec/fixtures/vcr/app_search/multi_query_search.yml +0 -63
- data/spec/fixtures/vcr/app_search/put_curation.yml +0 -113
- data/spec/fixtures/vcr/app_search/put_synonym_set.yml +0 -56
- data/spec/fixtures/vcr/app_search/search.yml +0 -57
- data/spec/fixtures/vcr/app_search/single_query_search.yml +0 -60
- data/spec/fixtures/vcr/app_search/synonym_set.yml +0 -56
- data/spec/integration/workplace_search_spec.rb +0 -253
@@ -26,13 +26,13 @@ module Elastic
|
|
26
26
|
#
|
27
27
|
# @param arguments [Hash] endpoint arguments
|
28
28
|
# @option arguments [String] :access_token OAuth Access Token (*Required*)
|
29
|
-
# @option arguments [
|
30
|
-
# @option body [String] :type
|
31
|
-
# @option body [String] :query_id query identifier for the event
|
32
|
-
# @option body [Integer] :page page number of the document in the query result set
|
33
|
-
# @option body [String] :content_source_id content source identifier for the event document
|
34
|
-
# @option body [String] :document_id document identifier for the event
|
35
|
-
# @option body [Integer] :rank rank of the document in the overall result set
|
29
|
+
# @option arguments [Hash] :body Workplace Search analytics event (Required: type, query_id, page, content_source_id, document_id, rank)
|
30
|
+
# @option body [String] :type (*Required)
|
31
|
+
# @option body [String] :query_id query identifier for the event (*Required)
|
32
|
+
# @option body [Integer] :page page number of the document in the query result set (*Required)
|
33
|
+
# @option body [String] :content_source_id content source identifier for the event document (*Required)
|
34
|
+
# @option body [String] :document_id document identifier for the event (*Required)
|
35
|
+
# @option body [Integer] :rank rank of the document in the overall result set (*Required)
|
36
36
|
# @option body [String] :event the target identifier for a click event
|
37
37
|
# @option body [Integer] :score the feedback score, constrained to the values -1 or 1
|
38
38
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module WorkplaceSearch
|
23
|
+
module Actions
|
24
|
+
# Synonyms - Create a batch of synonym sets
|
25
|
+
# Create batched synonym sets
|
26
|
+
#
|
27
|
+
# @param arguments [Hash] endpoint arguments
|
28
|
+
# @option arguments [Hash] :body
|
29
|
+
# @option body :synonyms
|
30
|
+
# @option body :synonym_sets
|
31
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
32
|
+
#
|
33
|
+
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-synonyms-api.html#create-synonyms
|
34
|
+
#
|
35
|
+
def create_batch_synonym_sets(arguments = {})
|
36
|
+
body = arguments.delete(:body) || {}
|
37
|
+
headers = arguments.delete(:headers) || {}
|
38
|
+
|
39
|
+
request(
|
40
|
+
:post,
|
41
|
+
'api/ws/v1/synonyms/',
|
42
|
+
arguments,
|
43
|
+
body,
|
44
|
+
headers
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -25,11 +25,14 @@ module Elastic
|
|
25
25
|
# Create a custom content source
|
26
26
|
#
|
27
27
|
# @param arguments [Hash] endpoint arguments
|
28
|
-
# @option arguments [
|
29
|
-
# @option body [String] :name The human readable display name for this Content Source.
|
28
|
+
# @option arguments [Hash] :body Definition to create a Workplace Search Content Source (Required: name)
|
29
|
+
# @option body [String] :name The human readable display name for this Content Source. (*Required)
|
30
30
|
# @option body :schema The schema that each document in this Content Source will adhere to.
|
31
31
|
# @option body :display The display details which governs which fields will be displayed, and in what order, in the search results.
|
32
32
|
# @option body [Boolean] :is_searchable Whether or not this Content Source will be searchable on the search page.
|
33
|
+
# @option body :indexing
|
34
|
+
# @option body :facets
|
35
|
+
# @option body :automatic_query_refinement
|
33
36
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
34
37
|
#
|
35
38
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources-api.html#create-content-source-api
|
@@ -26,9 +26,9 @@ module Elastic
|
|
26
26
|
#
|
27
27
|
# @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
28
|
# @param arguments [Hash] endpoint arguments
|
29
|
-
# @option arguments [
|
30
|
-
# @option body [String] :source_user_id
|
31
|
-
# @option body [String] :user
|
29
|
+
# @option arguments [Hash] :body (Required: source_user_id, user)
|
30
|
+
# @option body [String] :source_user_id (*Required)
|
31
|
+
# @option body [String] :user (*Required)
|
32
32
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
33
33
|
#
|
34
34
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-external-identities-api.html#add-external-identity
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module WorkplaceSearch
|
23
|
+
module Actions
|
24
|
+
# - Get the authenticated user
|
25
|
+
# Get the authenticated user
|
26
|
+
#
|
27
|
+
# @param arguments [Hash] endpoint arguments
|
28
|
+
# @option arguments [Boolean] :get_token Whether or not to include an access token in the response.
|
29
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
|
+
#
|
31
|
+
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-user-api.html#get-current-user-api
|
32
|
+
#
|
33
|
+
def current_user(arguments = {})
|
34
|
+
headers = arguments.delete(:headers) || {}
|
35
|
+
|
36
|
+
request(
|
37
|
+
:get,
|
38
|
+
'api/ws/v1/whoami/',
|
39
|
+
arguments,
|
40
|
+
{},
|
41
|
+
headers
|
42
|
+
)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module WorkplaceSearch
|
23
|
+
module Actions
|
24
|
+
# Documents - Deletes documents by query in a custom content source
|
25
|
+
# Deletes documents by query in a custom content source
|
26
|
+
#
|
27
|
+
# @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
|
+
# @param arguments [Hash] endpoint arguments
|
29
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
|
+
#
|
31
|
+
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-custom-sources-api.html#delete-documents-by-query
|
32
|
+
#
|
33
|
+
def delete_documents_by_query(content_source_id, arguments = {})
|
34
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
35
|
+
|
36
|
+
body = arguments.delete(:body) || {}
|
37
|
+
headers = arguments.delete(:headers) || {}
|
38
|
+
|
39
|
+
request(
|
40
|
+
:delete,
|
41
|
+
"api/ws/v1/sources/#{content_source_id}/documents/",
|
42
|
+
arguments,
|
43
|
+
body,
|
44
|
+
headers
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module WorkplaceSearch
|
23
|
+
module Actions
|
24
|
+
# Synonyms - Delete a synonym set
|
25
|
+
# Delete a synonym set
|
26
|
+
#
|
27
|
+
# @param arguments [Hash] endpoint arguments
|
28
|
+
# @option arguments [String] :synonym_set_id Synonym Set ID (*Required*)
|
29
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
|
+
#
|
31
|
+
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-synonyms-api.html#delete-synonym
|
32
|
+
#
|
33
|
+
def delete_synonym_set(arguments = {})
|
34
|
+
raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id]
|
35
|
+
|
36
|
+
synonym_set_id = arguments[:synonym_set_id]
|
37
|
+
|
38
|
+
headers = arguments.delete(:headers) || {}
|
39
|
+
|
40
|
+
request(
|
41
|
+
:delete,
|
42
|
+
"api/ws/v1/synonyms/#{synonym_set_id}/",
|
43
|
+
arguments,
|
44
|
+
{},
|
45
|
+
headers
|
46
|
+
)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -26,7 +26,7 @@ module Elastic
|
|
26
26
|
#
|
27
27
|
# @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
28
|
# @param arguments [Hash] endpoint arguments
|
29
|
-
# @option arguments [String] :document_id
|
29
|
+
# @option arguments [String] :document_id Unique ID for a content source document. Provided upon or returned at creation. (*Required*)
|
30
30
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
31
|
#
|
32
32
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources-api.html#get-document-by-id-api
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module WorkplaceSearch
|
23
|
+
module Actions
|
24
|
+
# Synonyms - Retrieves all synonym sets
|
25
|
+
# Retrieve a list of synonym sets
|
26
|
+
#
|
27
|
+
# @param arguments [Hash] endpoint arguments
|
28
|
+
# @option arguments [Hash] :body
|
29
|
+
# @option body :page
|
30
|
+
# @option body :sort
|
31
|
+
# @option body :filter
|
32
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
33
|
+
#
|
34
|
+
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-synonyms-api.html#list-synonyms
|
35
|
+
#
|
36
|
+
def list_synonym_sets(arguments = {})
|
37
|
+
body = arguments.delete(:body) || {}
|
38
|
+
headers = arguments.delete(:headers) || {}
|
39
|
+
|
40
|
+
request(
|
41
|
+
:get,
|
42
|
+
'api/ws/v1/synonyms/',
|
43
|
+
arguments,
|
44
|
+
body,
|
45
|
+
headers
|
46
|
+
)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -22,15 +22,18 @@ module Elastic
|
|
22
22
|
module WorkplaceSearch
|
23
23
|
module Actions
|
24
24
|
# ContentSources - Update a content source
|
25
|
-
# Update a
|
25
|
+
# Update a content source
|
26
26
|
#
|
27
27
|
# @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
28
|
# @param arguments [Hash] endpoint arguments
|
29
|
-
# @option arguments [
|
30
|
-
# @option body [String] :name The human readable display name for this Content Source.
|
29
|
+
# @option arguments [Hash] :body Definition to update a Workplace Search Content Source (Required: name, is_searchable)
|
30
|
+
# @option body [String] :name The human readable display name for this Content Source. (*Required)
|
31
31
|
# @option body :schema The schema that each document in this Content Source will adhere to.
|
32
32
|
# @option body :display The display details which governs which fields will be displayed, and in what order, in the search results.
|
33
|
-
# @option body [Boolean] :is_searchable Whether or not this Content Source will be searchable on the search page.
|
33
|
+
# @option body [Boolean] :is_searchable Whether or not this Content Source will be searchable on the search page. (*Required)
|
34
|
+
# @option body :indexing
|
35
|
+
# @option body :facets
|
36
|
+
# @option body :automatic_query_refinement
|
34
37
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
35
38
|
#
|
36
39
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources-api.html#update-content-source-api
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module WorkplaceSearch
|
23
|
+
module Actions
|
24
|
+
# ContentSources - Upload content source icons
|
25
|
+
# Upload content source icons
|
26
|
+
#
|
27
|
+
# @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
|
+
# @param arguments [Hash] endpoint arguments
|
29
|
+
# @option arguments [Hash] :body Definition to upload Workplace Search Custom Source icons
|
30
|
+
# @option body [String] :main_icon
|
31
|
+
# @option body [String] :alt_icon
|
32
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
33
|
+
#
|
34
|
+
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources-api.html#upload-content-source-icon-api
|
35
|
+
#
|
36
|
+
def put_content_source_icons(content_source_id, arguments = {})
|
37
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
38
|
+
|
39
|
+
body = arguments.delete(:body) || {}
|
40
|
+
headers = arguments.delete(:headers) || {}
|
41
|
+
|
42
|
+
request(
|
43
|
+
:put,
|
44
|
+
"api/ws/v1/sources/#{content_source_id}/icon/",
|
45
|
+
arguments,
|
46
|
+
body,
|
47
|
+
headers
|
48
|
+
)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -27,9 +27,9 @@ module Elastic
|
|
27
27
|
# @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
28
|
# @param arguments [Hash] endpoint arguments
|
29
29
|
# @option arguments [String] :user The username in context (*Required*)
|
30
|
-
# @option arguments [
|
31
|
-
# @option body [String] :source_user_id
|
32
|
-
# @option body [String] :user
|
30
|
+
# @option arguments [Hash] :body (Required: source_user_id, user)
|
31
|
+
# @option body [String] :source_user_id (*Required)
|
32
|
+
# @option body [String] :user (*Required)
|
33
33
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
34
34
|
#
|
35
35
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-external-identities-api.html#update-external-identity
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module WorkplaceSearch
|
23
|
+
module Actions
|
24
|
+
# Synonyms - Update a synonym set
|
25
|
+
# Update a synonym set
|
26
|
+
#
|
27
|
+
# @param arguments [Hash] endpoint arguments
|
28
|
+
# @option arguments [String] :synonym_set_id Synonym Set ID (*Required*)
|
29
|
+
# @option arguments [Hash] :body (Required: synonyms)
|
30
|
+
# @option body [Array] :synonyms A list of terms for this synonym set (*Required)
|
31
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
32
|
+
#
|
33
|
+
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-synonyms-api.html#update-synonym
|
34
|
+
#
|
35
|
+
def put_synonym_set(arguments = {})
|
36
|
+
raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id]
|
37
|
+
|
38
|
+
synonym_set_id = arguments.delete(:synonym_set_id)
|
39
|
+
body = arguments.delete(:body) || {}
|
40
|
+
headers = arguments.delete(:headers) || {}
|
41
|
+
|
42
|
+
request(
|
43
|
+
:put,
|
44
|
+
"api/ws/v1/synonyms/#{synonym_set_id}/",
|
45
|
+
arguments,
|
46
|
+
body,
|
47
|
+
headers
|
48
|
+
)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module WorkplaceSearch
|
23
|
+
module Actions
|
24
|
+
# Update current triggers blocklist
|
25
|
+
#
|
26
|
+
# @param arguments [Hash] endpoint arguments
|
27
|
+
# @option arguments [Hash] :body The request body
|
28
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
29
|
+
#
|
30
|
+
# @see https://www.elastic.co/guide/en/workplace-search/current/automatic-query-refinement-blocklist.html
|
31
|
+
#
|
32
|
+
def put_triggers_blocklist(arguments = {})
|
33
|
+
body = arguments.delete(:body) || {}
|
34
|
+
headers = arguments.delete(:headers) || {}
|
35
|
+
|
36
|
+
request(
|
37
|
+
:put,
|
38
|
+
'api/ws/v1/automatic_query_refinement/',
|
39
|
+
arguments,
|
40
|
+
body,
|
41
|
+
headers
|
42
|
+
)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -26,7 +26,7 @@ module Elastic
|
|
26
26
|
#
|
27
27
|
# @param arguments [Hash] endpoint arguments
|
28
28
|
# @option arguments [String] :access_token OAuth Access Token (*Required*)
|
29
|
-
# @option arguments [
|
29
|
+
# @option arguments [Hash] :body
|
30
30
|
# @option body [String] :query A string or number used to find related documents
|
31
31
|
# @option body [Boolean] :automatic_query_refinement Set to false to not automatically refine the query by keywords
|
32
32
|
# @option body [Object] :page Paging controls for the result set
|
@@ -36,6 +36,9 @@ module Elastic
|
|
36
36
|
# @option body :sort
|
37
37
|
# @option body [Object] :facets
|
38
38
|
# @option body [Object] :boosts
|
39
|
+
# @option body :source_type Optional parameter to search standard, remote only, or all available sources
|
40
|
+
# @option body [Integer] :timeout Optional timeout in ms for searching remote sources
|
41
|
+
# @option body [Array] :content_sources Optional list of content source ids to only return results from
|
39
42
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
40
43
|
#
|
41
44
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-search-api.html
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module WorkplaceSearch
|
23
|
+
module Actions
|
24
|
+
# Synonyms - Retrieve a synonym set by ID
|
25
|
+
# Retrieve a synonym set by ID
|
26
|
+
#
|
27
|
+
# @param arguments [Hash] endpoint arguments
|
28
|
+
# @option arguments [String] :synonym_set_id Synonym Set ID (*Required*)
|
29
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
|
+
#
|
31
|
+
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-synonyms-api.html#show-synonym
|
32
|
+
#
|
33
|
+
def synonym_set(arguments = {})
|
34
|
+
raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id]
|
35
|
+
|
36
|
+
synonym_set_id = arguments[:synonym_set_id]
|
37
|
+
|
38
|
+
headers = arguments.delete(:headers) || {}
|
39
|
+
|
40
|
+
request(
|
41
|
+
:get,
|
42
|
+
"api/ws/v1/synonyms/#{synonym_set_id}/",
|
43
|
+
arguments,
|
44
|
+
{},
|
45
|
+
headers
|
46
|
+
)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module WorkplaceSearch
|
23
|
+
module Actions
|
24
|
+
# Get current triggers blocklist
|
25
|
+
#
|
26
|
+
# @param arguments [Hash] endpoint arguments
|
27
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
28
|
+
#
|
29
|
+
# @see https://www.elastic.co/guide/en/workplace-search/current/automatic-query-refinement-blocklist.html
|
30
|
+
#
|
31
|
+
def triggers_blocklist(arguments = {})
|
32
|
+
headers = arguments.delete(:headers) || {}
|
33
|
+
|
34
|
+
request(
|
35
|
+
:get,
|
36
|
+
'api/ws/v1/automatic_query_refinement/',
|
37
|
+
arguments,
|
38
|
+
{},
|
39
|
+
headers
|
40
|
+
)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -21,25 +21,10 @@ module Elastic
|
|
21
21
|
module EnterpriseSearch
|
22
22
|
# Workplace Search client for Enterprise Search.
|
23
23
|
module WorkplaceSearch
|
24
|
-
# The Request module is included in the WorkplaceSearch Client to override
|
25
|
-
# EnterpriseSearch client's authentication method with Workplace's
|
26
|
-
# authentication.
|
27
|
-
module Request
|
28
|
-
def setup_authentication_header
|
29
|
-
case http_auth
|
30
|
-
when Hash
|
31
|
-
basic_auth_header
|
32
|
-
when String
|
33
|
-
"Bearer #{http_auth}"
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
24
|
# The Workplace Search Client
|
39
25
|
# Extends EnterpriseSearch client but overrides authentication to use access token.
|
40
26
|
class Client < Elastic::EnterpriseSearch::Client
|
41
27
|
include Elastic::EnterpriseSearch::WorkplaceSearch::Actions
|
42
|
-
include Elastic::EnterpriseSearch::WorkplaceSearch::Request
|
43
28
|
include Elastic::EnterpriseSearch::Utils
|
44
29
|
|
45
30
|
# Create a new Elastic::EnterpriseSearch::WorkplaceSearch::Client client
|