elastic-enterprise-search 7.17.0 → 8.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ci/jobs/elastic+enterprise-search-ruby+7.15.yml +12 -0
- data/.ci/jobs/elastic+enterprise-search-ruby+7.16.yml +12 -0
- data/.ci/test-matrix.yml +1 -2
- data/.github/workflows/testing.yml +3 -4
- data/.rubocop.yml +1 -1
- data/CHANGELOG +1 -0
- data/CODE_OF_CONDUCT +1 -0
- data/CONTRIBUTING.md +37 -0
- data/NOTICE +2 -0
- data/README.md +25 -29
- data/docs/guide/app-search-api.asciidoc +52 -18
- data/docs/guide/overview.asciidoc +11 -3
- data/docs/guide/release_notes/712.asciidoc +10 -0
- data/docs/guide/release_notes/80.asciidoc +117 -0
- data/docs/guide/release_notes/81.asciidoc +8 -0
- data/docs/guide/release_notes/index.asciidoc +6 -0
- data/docs/guide/workplace-search-api.asciidoc +14 -7
- data/elastic-enterprise-search.gemspec +3 -3
- data/lib/elastic/api/response.rb +52 -0
- data/lib/elastic/{workplace-search/api/user_permissions.rb → app-search/api/adaptive_relevance_settings.rb} +10 -15
- data/lib/elastic/{workplace-search/api/add_user_permissions.rb → app-search/api/adaptive_relevance_suggestions.rb} +19 -14
- data/lib/elastic/app-search/api/add_meta_engine_source.rb +3 -5
- data/lib/elastic/app-search/api/api_key.rb +3 -6
- data/lib/elastic/app-search/api/api_logs.rb +7 -15
- data/lib/elastic/app-search/api/count_analytics.rb +4 -5
- data/lib/elastic/app-search/api/crawler_active_crawl_request.rb +4 -7
- data/lib/elastic/app-search/api/crawler_crawl_request.rb +5 -8
- data/lib/elastic/app-search/api/crawler_crawl_schedule.rb +4 -7
- data/lib/elastic/app-search/api/crawler_domain.rb +5 -8
- data/lib/elastic/app-search/api/crawler_domain_validation_result.rb +5 -5
- data/lib/elastic/app-search/api/crawler_metrics.rb +3 -6
- data/lib/elastic/app-search/api/crawler_overview.rb +4 -7
- data/lib/elastic/app-search/api/crawler_process_crawl.rb +5 -8
- data/lib/elastic/app-search/api/crawler_process_crawl_denied_urls.rb +5 -8
- data/lib/elastic/app-search/api/crawler_url_extraction_result.rb +6 -7
- data/lib/elastic/app-search/api/crawler_url_tracing_result.rb +6 -7
- data/lib/elastic/app-search/api/crawler_url_validation_result.rb +6 -7
- data/lib/elastic/app-search/api/crawler_user_agent.rb +3 -6
- data/lib/elastic/app-search/api/create_api_key.rb +9 -10
- data/lib/elastic/app-search/api/create_crawler_crawl_request.rb +9 -5
- data/lib/elastic/app-search/api/create_crawler_crawl_rule.rb +12 -11
- data/lib/elastic/app-search/api/create_crawler_domain.rb +7 -8
- data/lib/elastic/app-search/api/create_crawler_entry_point.rb +9 -8
- data/lib/elastic/app-search/api/create_crawler_process_crawl.rb +5 -6
- data/lib/elastic/app-search/api/create_crawler_sitemap.rb +9 -8
- data/lib/elastic/app-search/api/create_curation.rb +9 -8
- data/lib/elastic/app-search/api/create_engine.rb +7 -7
- data/lib/elastic/app-search/api/create_synonym_set.rb +5 -6
- data/lib/elastic/app-search/api/curation.rb +4 -7
- data/lib/elastic/app-search/api/delete_api_key.rb +3 -6
- data/lib/elastic/app-search/api/delete_crawler_active_crawl_request.rb +4 -7
- data/lib/elastic/app-search/api/delete_crawler_crawl_rule.rb +6 -9
- data/lib/elastic/app-search/api/delete_crawler_crawl_schedule.rb +4 -7
- data/lib/elastic/app-search/api/delete_crawler_domain.rb +5 -8
- data/lib/elastic/app-search/api/delete_crawler_entry_point.rb +6 -9
- data/lib/elastic/app-search/api/delete_crawler_sitemap.rb +6 -9
- data/lib/elastic/app-search/api/delete_curation.rb +4 -7
- data/lib/elastic/app-search/api/delete_documents.rb +3 -5
- data/lib/elastic/app-search/api/delete_engine.rb +3 -6
- data/lib/elastic/app-search/api/delete_meta_engine_source.rb +3 -4
- data/lib/elastic/app-search/api/delete_synonym_set.rb +4 -7
- data/lib/elastic/app-search/api/documents.rb +4 -5
- data/lib/elastic/app-search/api/engine.rb +3 -6
- data/lib/elastic/app-search/api/index_documents.rb +3 -5
- data/lib/elastic/{workplace-search/api/remove_user_permissions.rb → app-search/api/list_adaptive_relevance_suggestions.rb} +12 -14
- data/lib/elastic/app-search/api/list_api_keys.rb +2 -5
- data/lib/elastic/app-search/api/list_crawler_crawl_requests.rb +6 -8
- data/lib/elastic/{workplace-search/api/list_permissions.rb → app-search/api/list_crawler_domains.rb} +12 -13
- data/lib/elastic/app-search/api/list_crawler_process_crawls.rb +6 -7
- data/lib/elastic/app-search/api/list_curations.rb +3 -6
- data/lib/elastic/app-search/api/list_documents.rb +3 -6
- data/lib/elastic/app-search/api/list_engines.rb +2 -5
- data/lib/elastic/app-search/api/list_synonym_sets.rb +3 -6
- data/lib/elastic/app-search/api/log_clickthrough.rb +8 -8
- data/lib/elastic/{workplace-search/api/put_user_permissions.rb → app-search/api/put_adaptive_relevance_settings.rb} +12 -14
- data/lib/elastic/app-search/api/put_adaptive_relevance_suggestions.rb +50 -0
- data/lib/elastic/app-search/api/put_api_key.rb +10 -10
- data/lib/elastic/app-search/api/put_crawler_crawl_rule.rb +13 -12
- data/lib/elastic/app-search/api/put_crawler_crawl_schedule.rb +7 -7
- data/lib/elastic/app-search/api/put_crawler_domain.rb +8 -9
- data/lib/elastic/app-search/api/put_crawler_entry_point.rb +10 -9
- data/lib/elastic/app-search/api/put_crawler_sitemap.rb +10 -9
- data/lib/elastic/app-search/api/put_curation.rb +10 -9
- data/lib/elastic/app-search/api/put_documents.rb +3 -4
- data/lib/elastic/app-search/api/put_schema.rb +3 -4
- data/lib/elastic/app-search/api/put_search_settings.rb +5 -6
- data/lib/elastic/app-search/api/put_synonym_set.rb +7 -8
- data/lib/elastic/app-search/api/query_suggestion.rb +4 -5
- data/lib/elastic/app-search/api/refresh_adaptive_relevance_update_process.rb +55 -0
- data/lib/elastic/app-search/api/reset_search_settings.rb +3 -6
- data/lib/elastic/app-search/api/schema.rb +3 -6
- data/lib/elastic/app-search/api/search.rb +5 -5
- data/lib/elastic/app-search/api/search_settings.rb +3 -6
- data/lib/elastic/app-search/api/synonym_set.rb +4 -7
- data/lib/elastic/app-search/api/top_clicks_analytics.rb +4 -5
- data/lib/elastic/app-search/api/top_queries_analytics.rb +3 -4
- data/lib/elastic/enterprise-search/api/health.rb +2 -3
- data/lib/elastic/enterprise-search/api/put_read_only.rb +5 -4
- data/lib/elastic/enterprise-search/api/read_only.rb +2 -3
- data/lib/elastic/enterprise-search/api/stats.rb +2 -3
- data/lib/elastic/enterprise-search/api/version.rb +2 -3
- data/lib/elastic/enterprise-search/client.rb +8 -13
- data/lib/elastic/enterprise-search/request.rb +5 -3
- data/lib/elastic/enterprise-search/version.rb +1 -1
- data/lib/elastic/workplace-search/api/auto_query_refinement_details.rb +3 -4
- data/lib/elastic/workplace-search/api/command_sync_jobs.rb +4 -5
- data/lib/elastic/workplace-search/api/content_source.rb +3 -4
- data/lib/elastic/workplace-search/api/create_analytics_event.rb +16 -12
- data/lib/elastic/workplace-search/api/create_batch_synonym_sets.rb +4 -3
- data/lib/elastic/workplace-search/api/create_content_source.rb +6 -5
- data/lib/elastic/workplace-search/api/create_external_identity.rb +11 -6
- data/lib/elastic/workplace-search/api/current_user.rb +3 -5
- data/lib/elastic/workplace-search/api/delete_content_source.rb +3 -4
- data/lib/elastic/workplace-search/api/delete_documents.rb +4 -4
- data/lib/elastic/workplace-search/api/delete_documents_by_query.rb +4 -3
- data/lib/elastic/workplace-search/api/delete_external_identity.rb +7 -9
- data/lib/elastic/workplace-search/api/delete_synonym_set.rb +3 -5
- data/lib/elastic/workplace-search/api/document.rb +4 -6
- data/lib/elastic/workplace-search/api/external_identity.rb +7 -9
- data/lib/elastic/workplace-search/api/index_documents.rb +3 -4
- data/lib/elastic/workplace-search/api/list_content_sources.rb +2 -3
- data/lib/elastic/workplace-search/api/list_documents.rb +4 -5
- data/lib/elastic/workplace-search/api/list_external_identities.rb +3 -4
- data/lib/elastic/workplace-search/api/list_synonym_sets.rb +1 -2
- data/lib/elastic/workplace-search/api/put_content_source.rb +6 -6
- data/lib/elastic/workplace-search/api/put_content_source_icons.rb +6 -6
- data/lib/elastic/workplace-search/api/put_external_identity.rb +11 -10
- data/lib/elastic/workplace-search/api/put_synonym_set.rb +4 -4
- data/lib/elastic/workplace-search/api/put_triggers_blocklist.rb +3 -5
- data/lib/elastic/workplace-search/api/search.rb +13 -13
- data/lib/elastic/workplace-search/api/synonym_set.rb +3 -5
- data/lib/elastic/workplace-search/api/triggers_blocklist.rb +3 -3
- data/spec/app-search/client_spec.rb +29 -0
- data/spec/enterprise-search/client_spec.rb +29 -0
- data/spec/enterprise-search/request_spec.rb +1 -1
- data/spec/integration/app-search/adaptive_relevance_settings_spec.rb +60 -0
- data/spec/integration/app-search/adaptive_relevance_suggestions_spec.rb +54 -0
- data/spec/integration/app-search/api_logs_spec.rb +11 -3
- data/spec/integration/app-search/app_search_helper.rb +2 -2
- data/spec/integration/app-search/count_analytics_spec.rb +3 -2
- data/spec/integration/app-search/crawler_domain_spec.rb +16 -0
- data/spec/integration/app-search/curations_spec.rb +15 -9
- data/spec/integration/app-search/engines_spec.rb +24 -26
- data/spec/integration/app-search/log_clickthrough_spec.rb +1 -1
- data/spec/integration/app-search/meta_engines_spec.rb +5 -5
- data/spec/integration/app-search/search_and_multiple_search_spec.rb +1 -1
- data/spec/integration/workplace-search/content_sources_spec.rb +6 -6
- data/spec/integration/workplace-search/documents_spec.rb +20 -10
- data/spec/integration/workplace-search/external_identities_spec.rb +26 -16
- data/spec/integration/workplace-search/triggers_spec.rb +2 -2
- data/spec/integration/workplace-search/users_spec.rb +0 -6
- data/spec/workplace-search/client_spec.rb +29 -0
- metadata +27 -19
- data/.ci/jobs/elastic+enterprise-search-ruby+7.10.0.beta.1.yml +0 -12
- data/.github/compatibility/Gemfile +0 -23
- data/.github/workflows/compatibility.yml +0 -20
- data/spec/integration/workplace-search/permissions_spec.rb +0 -77
@@ -24,11 +24,11 @@ module Elastic
|
|
24
24
|
# Analytics - Query for analytics query data
|
25
25
|
# Returns queries analytics by usage count
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
27
|
+
# @param [String] engine_name Name of the engine (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
29
|
# @option arguments [Hash] :body
|
30
30
|
# @option body :filters
|
31
|
-
# @option body [
|
31
|
+
# @option body [Hash] :page (Required: size)
|
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/app-search/current/queries.html#queries-top-queries
|
@@ -38,7 +38,6 @@ module Elastic
|
|
38
38
|
|
39
39
|
body = arguments.delete(:body) || {}
|
40
40
|
headers = arguments.delete(:headers) || {}
|
41
|
-
|
42
41
|
request(
|
43
42
|
:post,
|
44
43
|
"api/as/v1/engines/#{engine_name}/analytics/queries/",
|
@@ -23,19 +23,18 @@ module Elastic
|
|
23
23
|
# Health - Get information on the health of a deployment and basic statistics around resource usage
|
24
24
|
# Get information on the health of a deployment and basic statistics around resource usage
|
25
25
|
#
|
26
|
-
# @param
|
26
|
+
# @param [Hash] arguments endpoint arguments
|
27
27
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
28
28
|
#
|
29
29
|
# @see https://www.elastic.co/guide/en/enterprise-search/current/monitoring-apis.html#health-api-example
|
30
30
|
#
|
31
31
|
def health(arguments = {})
|
32
32
|
headers = arguments.delete(:headers) || {}
|
33
|
-
|
34
33
|
request(
|
35
34
|
:get,
|
36
35
|
'api/ent/v1/internal/health/',
|
37
36
|
arguments,
|
38
|
-
|
37
|
+
nil,
|
39
38
|
headers
|
40
39
|
)
|
41
40
|
end
|
@@ -23,17 +23,18 @@ module Elastic
|
|
23
23
|
# Read-Only - Update the read-only flag's state
|
24
24
|
# Update the read-only flag's state
|
25
25
|
#
|
26
|
-
# @param
|
27
|
-
# @option arguments [Hash] :body
|
28
|
-
# @option body [
|
26
|
+
# @param [Hash] arguments endpoint arguments
|
27
|
+
# @option arguments [Hash] :body (Required: enabled)
|
28
|
+
# @option body [boolean] :enabled
|
29
29
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
30
|
#
|
31
31
|
# @see https://www.elastic.co/guide/en/enterprise-search/current/read-only-api.html#setting-read-only-state
|
32
32
|
#
|
33
33
|
def put_read_only(arguments = {})
|
34
|
+
raise ArgumentError, "Required parameter 'body (enabled)' missing" unless arguments[:body]
|
35
|
+
|
34
36
|
body = arguments.delete(:body) || {}
|
35
37
|
headers = arguments.delete(:headers) || {}
|
36
|
-
|
37
38
|
request(
|
38
39
|
:put,
|
39
40
|
'api/ent/v1/internal/read_only_mode/',
|
@@ -23,19 +23,18 @@ module Elastic
|
|
23
23
|
# Read-Only - Get the read-only flag's state
|
24
24
|
# Get the read-only flag's state
|
25
25
|
#
|
26
|
-
# @param
|
26
|
+
# @param [Hash] arguments endpoint arguments
|
27
27
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
28
28
|
#
|
29
29
|
# @see https://www.elastic.co/guide/en/enterprise-search/current/read-only-api.html#getting-read-only-state
|
30
30
|
#
|
31
31
|
def read_only(arguments = {})
|
32
32
|
headers = arguments.delete(:headers) || {}
|
33
|
-
|
34
33
|
request(
|
35
34
|
:get,
|
36
35
|
'api/ent/v1/internal/read_only_mode/',
|
37
36
|
arguments,
|
38
|
-
|
37
|
+
nil,
|
39
38
|
headers
|
40
39
|
)
|
41
40
|
end
|
@@ -23,7 +23,7 @@ module Elastic
|
|
23
23
|
# Stats - Get information about the resource usage of the application, the state of different internal queues, etc.
|
24
24
|
# Get information about the resource usage of the application, the state of different internal queues, etc.
|
25
25
|
#
|
26
|
-
# @param
|
26
|
+
# @param [Hash] arguments endpoint arguments
|
27
27
|
# @option arguments [Array] :include Comma-separated list of stats to return
|
28
28
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
29
29
|
#
|
@@ -31,12 +31,11 @@ module Elastic
|
|
31
31
|
#
|
32
32
|
def stats(arguments = {})
|
33
33
|
headers = arguments.delete(:headers) || {}
|
34
|
-
|
35
34
|
request(
|
36
35
|
:get,
|
37
36
|
'api/ent/v1/internal/stats/',
|
38
37
|
arguments,
|
39
|
-
|
38
|
+
nil,
|
40
39
|
headers
|
41
40
|
)
|
42
41
|
end
|
@@ -23,19 +23,18 @@ module Elastic
|
|
23
23
|
# Version - Get version information for this server
|
24
24
|
# Get version information for this server
|
25
25
|
#
|
26
|
-
# @param
|
26
|
+
# @param [Hash] arguments endpoint arguments
|
27
27
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
28
28
|
#
|
29
29
|
# @see https://www.elastic.co/guide/en/enterprise-search/current/management-apis.html
|
30
30
|
#
|
31
31
|
def version(arguments = {})
|
32
32
|
headers = arguments.delete(:headers) || {}
|
33
|
-
|
34
33
|
request(
|
35
34
|
:get,
|
36
35
|
'api/ent/v1/internal/version/',
|
37
36
|
arguments,
|
38
|
-
|
37
|
+
nil,
|
39
38
|
headers
|
40
39
|
)
|
41
40
|
end
|
@@ -19,7 +19,7 @@
|
|
19
19
|
|
20
20
|
require 'elastic/enterprise-search/request'
|
21
21
|
require 'elastic/enterprise-search/utils'
|
22
|
-
require '
|
22
|
+
require 'elastic-transport'
|
23
23
|
|
24
24
|
module Elastic
|
25
25
|
module EnterpriseSearch
|
@@ -58,6 +58,7 @@ 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 [Symbol] :adapter A specific adapter for Faraday (e.g. `:patron`)
|
61
62
|
# @option enable_meta_header [Boolean] :enable_meta_header Enable sending the meta data header to Cloud.
|
62
63
|
# (Default: true)
|
63
64
|
def initialize(options = {})
|
@@ -67,11 +68,12 @@ module Elastic
|
|
67
68
|
|
68
69
|
def transport
|
69
70
|
@options[:transport] ||
|
70
|
-
|
71
|
+
Elastic::Transport::Client.new(
|
71
72
|
host: host,
|
72
73
|
log: log,
|
73
74
|
logger: logger,
|
74
75
|
request_timeout: overall_timeout,
|
76
|
+
adapter: adapter,
|
75
77
|
transport_options: {
|
76
78
|
request: { open_timeout: open_timeout }
|
77
79
|
},
|
@@ -103,6 +105,10 @@ module Elastic
|
|
103
105
|
@options[:logger]
|
104
106
|
end
|
105
107
|
|
108
|
+
def adapter
|
109
|
+
@options[:adapter]
|
110
|
+
end
|
111
|
+
|
106
112
|
def host
|
107
113
|
return DEFAULT_HOST unless @options[:host]
|
108
114
|
|
@@ -110,17 +116,6 @@ module Elastic
|
|
110
116
|
|
111
117
|
@options[:host]
|
112
118
|
end
|
113
|
-
|
114
|
-
private
|
115
|
-
|
116
|
-
def transport_klass
|
117
|
-
case Elasticsearch::Transport::VERSION
|
118
|
-
when /7\.1[123]/
|
119
|
-
Elasticsearch::Client
|
120
|
-
else
|
121
|
-
Elasticsearch::Transport::Client
|
122
|
-
end
|
123
|
-
end
|
124
119
|
end
|
125
120
|
end
|
126
121
|
end
|
@@ -19,6 +19,7 @@
|
|
19
19
|
|
20
20
|
require 'net/https'
|
21
21
|
require 'json'
|
22
|
+
require 'elastic/api/response'
|
22
23
|
require 'elastic/enterprise-search/exceptions'
|
23
24
|
require 'base64'
|
24
25
|
|
@@ -53,8 +54,9 @@ module Elastic
|
|
53
54
|
else
|
54
55
|
headers.merge(meta_headers)
|
55
56
|
end
|
56
|
-
|
57
|
-
|
57
|
+
Elastic::API::Response.new(
|
58
|
+
@transport.perform_request(method.to_s.upcase, path, params, body, headers)
|
59
|
+
)
|
58
60
|
end
|
59
61
|
|
60
62
|
def setup_authentication_header
|
@@ -84,7 +86,7 @@ module Elastic
|
|
84
86
|
meta << "#{RbConfig::CONFIG['host_os'].split('_').first[/[a-z]+/i].downcase} " \
|
85
87
|
"#{RbConfig::CONFIG['target_cpu']}"
|
86
88
|
end
|
87
|
-
meta << "
|
89
|
+
meta << "elastic-transport: #{Elastic::Transport::VERSION}"
|
88
90
|
"#{ua} (#{meta.join('; ')})"
|
89
91
|
end
|
90
92
|
|
@@ -24,8 +24,8 @@ module Elastic
|
|
24
24
|
# ContentSources - Retrieves a content source's automatic query refinement details
|
25
25
|
# Retrieves a content source's automatic query refinement details
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
27
|
+
# @param [String] content_source_id Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
29
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
30
|
#
|
31
31
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources-api.html#get-automatic-query-refinement-details-api
|
@@ -34,12 +34,11 @@ module Elastic
|
|
34
34
|
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
35
35
|
|
36
36
|
headers = arguments.delete(:headers) || {}
|
37
|
-
|
38
37
|
request(
|
39
38
|
:get,
|
40
39
|
"api/ws/v1/sources/#{content_source_id}/automatic_query_refinement/",
|
41
40
|
arguments,
|
42
|
-
|
41
|
+
nil,
|
43
42
|
headers
|
44
43
|
)
|
45
44
|
end
|
@@ -24,21 +24,20 @@ module Elastic
|
|
24
24
|
# SyncJobs - Issue commands to a Content Source's sync jobs
|
25
25
|
# Control a content source's sync jobs
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [Hash] :body Params to command a Workplace Search Content Source's sync jobs (Required: command)
|
27
|
+
# @param [String] content_source_id Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
30
29
|
# @option arguments [Array] :job_type The type of sync job to consider
|
31
|
-
# @option
|
30
|
+
# @option arguments [Any of: <Hash> - Command to start a synchronisation job for Content Source (force_interrupt<boolean>, command<string>) or <Hash> - Command to interrupt a synchronisation job for Content Source (command<string>)] :body *Required*
|
32
31
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
33
32
|
#
|
34
33
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-sync-jobs-api.html#command-sync-jobs-api
|
35
34
|
#
|
36
35
|
def command_sync_jobs(content_source_id, arguments = {})
|
37
36
|
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
37
|
+
raise ArgumentError, "Required parameter 'body' missing" unless arguments[:body]
|
38
38
|
|
39
39
|
body = arguments.delete(:body) || {}
|
40
40
|
headers = arguments.delete(:headers) || {}
|
41
|
-
|
42
41
|
request(
|
43
42
|
:post,
|
44
43
|
"api/ws/v1/sources/#{content_source_id}/sync/jobs/",
|
@@ -24,8 +24,8 @@ module Elastic
|
|
24
24
|
# ContentSources - Retrieves a content source by ID
|
25
25
|
# Retrieves a content source by ID
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
27
|
+
# @param [String] content_source_id Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
29
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
30
|
#
|
31
31
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources-api.html#get-content-source-api
|
@@ -34,12 +34,11 @@ module Elastic
|
|
34
34
|
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
35
35
|
|
36
36
|
headers = arguments.delete(:headers) || {}
|
37
|
-
|
38
37
|
request(
|
39
38
|
:get,
|
40
39
|
"api/ws/v1/sources/#{content_source_id}/",
|
41
40
|
arguments,
|
42
|
-
|
41
|
+
nil,
|
43
42
|
headers
|
44
43
|
)
|
45
44
|
end
|
@@ -24,17 +24,17 @@ module Elastic
|
|
24
24
|
# Analytics - Capture click and feedback analytic events
|
25
25
|
# Capture Analytic events for click and feedback
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @
|
29
|
-
# @option arguments [Hash] :body
|
30
|
-
# @option body [
|
31
|
-
# @option body [
|
32
|
-
# @option body [
|
33
|
-
# @option body [
|
34
|
-
# @option body [
|
35
|
-
# @option body [
|
36
|
-
# @option body [
|
37
|
-
# @option body [
|
27
|
+
# @param [Hash] arguments endpoint arguments
|
28
|
+
# @param [String] access_token OAuth Access Token (*Required*)
|
29
|
+
# @option arguments [Hash] :body (Required: type, query_id, page, content_source_id, document_id, rank)
|
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
|
36
|
+
# @option body [string] :event the target identifier for a click event
|
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
|
39
39
|
#
|
40
40
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-analytics-api.html
|
@@ -42,9 +42,13 @@ module Elastic
|
|
42
42
|
def create_analytics_event(arguments = {})
|
43
43
|
raise ArgumentError, "Required parameter 'access_token' missing" unless arguments[:access_token]
|
44
44
|
|
45
|
+
unless arguments[:body]
|
46
|
+
raise ArgumentError,
|
47
|
+
"Required parameter 'body (type,query_id,page,content_source_id,document_id,rank)' missing"
|
48
|
+
end
|
49
|
+
|
45
50
|
body = arguments.delete(:body) || {}
|
46
51
|
headers = arguments.delete(:headers) || {}
|
47
|
-
|
48
52
|
request(
|
49
53
|
:post,
|
50
54
|
'api/ws/v1/analytics/event/',
|
@@ -24,8 +24,8 @@ module Elastic
|
|
24
24
|
# Synonyms - Create a batch of synonym sets
|
25
25
|
# Create batched synonym sets
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @option arguments [Hash] :body
|
27
|
+
# @param [Hash] arguments endpoint arguments
|
28
|
+
# @option arguments [Hash] :body *Required*
|
29
29
|
# @option body :synonyms
|
30
30
|
# @option body :synonym_sets
|
31
31
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
@@ -33,9 +33,10 @@ module Elastic
|
|
33
33
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-synonyms-api.html#create-synonyms
|
34
34
|
#
|
35
35
|
def create_batch_synonym_sets(arguments = {})
|
36
|
+
raise ArgumentError, "Required parameter 'body' missing" unless arguments[:body]
|
37
|
+
|
36
38
|
body = arguments.delete(:body) || {}
|
37
39
|
headers = arguments.delete(:headers) || {}
|
38
|
-
|
39
40
|
request(
|
40
41
|
:post,
|
41
42
|
'api/ws/v1/synonyms/',
|
@@ -24,12 +24,12 @@ module Elastic
|
|
24
24
|
# ContentSources - Create a content source
|
25
25
|
# Create a custom content source
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @option arguments [Hash] :body
|
29
|
-
# @option body [
|
27
|
+
# @param [Hash] arguments endpoint arguments
|
28
|
+
# @option arguments [Hash] :body (Required: name)
|
29
|
+
# @option body [string] :name The human readable display name for this Content Source.
|
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
|
-
# @option body [
|
32
|
+
# @option body [boolean] :is_searchable Whether or not this Content Source will be searchable on the search page.
|
33
33
|
# @option body :indexing
|
34
34
|
# @option body :facets
|
35
35
|
# @option body :automatic_query_refinement
|
@@ -38,9 +38,10 @@ module Elastic
|
|
38
38
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources-api.html#create-content-source-api
|
39
39
|
#
|
40
40
|
def create_content_source(arguments = {})
|
41
|
+
raise ArgumentError, "Required parameter 'body (name)' missing" unless arguments[:body]
|
42
|
+
|
41
43
|
body = arguments.delete(:body) || {}
|
42
44
|
headers = arguments.delete(:headers) || {}
|
43
|
-
|
44
45
|
request(
|
45
46
|
:post,
|
46
47
|
'api/ws/v1/sources/',
|
@@ -24,11 +24,12 @@ module Elastic
|
|
24
24
|
# ExternalIdentities - Adds a new external identity
|
25
25
|
# Adds a new external identity
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [Hash] :body
|
30
|
-
# @option body [
|
31
|
-
# @option body [
|
27
|
+
# @param [String] content_source_id Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
|
+
# @option arguments [Hash] :body (Required: external_user_id, external_user_properties, permissions)
|
30
|
+
# @option body [string] :external_user_id
|
31
|
+
# @option body [Array<object>] :external_user_properties A list of external user properties, where each property is an object with an attribute_name and attribute_value.
|
32
|
+
# @option body [Array<string>] :permissions A list of user permissions.
|
32
33
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
33
34
|
#
|
34
35
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-external-identities-api.html#add-external-identity
|
@@ -36,9 +37,13 @@ module Elastic
|
|
36
37
|
def create_external_identity(content_source_id, arguments = {})
|
37
38
|
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
38
39
|
|
40
|
+
unless arguments[:body]
|
41
|
+
raise ArgumentError,
|
42
|
+
"Required parameter 'body (external_user_id,external_user_properties,permissions)' missing"
|
43
|
+
end
|
44
|
+
|
39
45
|
body = arguments.delete(:body) || {}
|
40
46
|
headers = arguments.delete(:headers) || {}
|
41
|
-
|
42
47
|
request(
|
43
48
|
:post,
|
44
49
|
"api/ws/v1/sources/#{content_source_id}/external_identities/",
|
@@ -21,23 +21,21 @@ module Elastic
|
|
21
21
|
module EnterpriseSearch
|
22
22
|
module WorkplaceSearch
|
23
23
|
module Actions
|
24
|
-
#
|
24
|
+
# getCurrentUser - Get the authenticated user
|
25
25
|
# Get the authenticated user
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @option arguments [Boolean] :get_token Whether or not to include an access token in the response.
|
27
|
+
# @param [Hash] arguments endpoint arguments
|
29
28
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
29
|
#
|
31
30
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-user-api.html#get-current-user-api
|
32
31
|
#
|
33
32
|
def current_user(arguments = {})
|
34
33
|
headers = arguments.delete(:headers) || {}
|
35
|
-
|
36
34
|
request(
|
37
35
|
:get,
|
38
36
|
'api/ws/v1/whoami/',
|
39
37
|
arguments,
|
40
|
-
|
38
|
+
nil,
|
41
39
|
headers
|
42
40
|
)
|
43
41
|
end
|
@@ -24,8 +24,8 @@ module Elastic
|
|
24
24
|
# ContentSources - Deletes a content source by ID
|
25
25
|
# Deletes a content source by ID
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
27
|
+
# @param [String] content_source_id Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
29
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
30
|
#
|
31
31
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources-api.html#remove-content-source-api
|
@@ -34,12 +34,11 @@ module Elastic
|
|
34
34
|
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
35
35
|
|
36
36
|
headers = arguments.delete(:headers) || {}
|
37
|
-
|
38
37
|
request(
|
39
38
|
:delete,
|
40
39
|
"api/ws/v1/sources/#{content_source_id}/",
|
41
40
|
arguments,
|
42
|
-
|
41
|
+
nil,
|
43
42
|
headers
|
44
43
|
)
|
45
44
|
end
|
@@ -24,19 +24,19 @@ module Elastic
|
|
24
24
|
# Documents - Deletes a list of documents from a custom content source
|
25
25
|
# Remove documents from a Custom API Source
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [Array] :document_ids
|
27
|
+
# @param [String] content_source_id Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
|
+
# @option arguments [Array<String>] :document_ids *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-custom-sources-api.html#delete-by-id
|
33
33
|
#
|
34
34
|
def delete_documents(content_source_id, arguments = {})
|
35
35
|
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
36
|
+
raise ArgumentError, "Required parameter 'document_ids' missing" unless arguments[:document_ids]
|
36
37
|
|
37
38
|
document_ids = arguments.delete(:document_ids) || {}
|
38
39
|
headers = arguments.delete(:headers) || {}
|
39
|
-
|
40
40
|
request(
|
41
41
|
:post,
|
42
42
|
"api/ws/v1/sources/#{content_source_id}/documents/bulk_destroy/",
|
@@ -24,8 +24,10 @@ module Elastic
|
|
24
24
|
# Documents - Deletes documents by query in a custom content source
|
25
25
|
# Deletes documents by query in a custom content source
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
27
|
+
# @param [String] content_source_id Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
|
+
# @option arguments [Hash] :body
|
30
|
+
# @option body [Hash] :filters
|
29
31
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
32
|
#
|
31
33
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-custom-sources-api.html#delete-documents-by-query
|
@@ -35,7 +37,6 @@ module Elastic
|
|
35
37
|
|
36
38
|
body = arguments.delete(:body) || {}
|
37
39
|
headers = arguments.delete(:headers) || {}
|
38
|
-
|
39
40
|
request(
|
40
41
|
:delete,
|
41
42
|
"api/ws/v1/sources/#{content_source_id}/documents/",
|
@@ -24,26 +24,24 @@ module Elastic
|
|
24
24
|
# ExternalIdentities - Deletes an external identity
|
25
25
|
# Deletes an external identity
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [String] :user
|
27
|
+
# @param [String] content_source_id Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
|
+
# @option arguments [String] :external_user_id Unique identifier of an external user, such as username or email address. (*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-external-identities-api.html#remove-external-identity
|
33
33
|
#
|
34
34
|
def delete_external_identity(content_source_id, arguments = {})
|
35
35
|
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
36
|
-
raise ArgumentError, "Required parameter '
|
37
|
-
|
38
|
-
user = arguments[:user]
|
36
|
+
raise ArgumentError, "Required parameter 'external_user_id' missing" unless arguments[:external_user_id]
|
39
37
|
|
38
|
+
external_user_id = arguments.delete(:external_user_id)
|
40
39
|
headers = arguments.delete(:headers) || {}
|
41
|
-
|
42
40
|
request(
|
43
41
|
:delete,
|
44
|
-
"api/ws/v1/sources/#{content_source_id}/external_identities/#{
|
42
|
+
"api/ws/v1/sources/#{content_source_id}/external_identities/#{external_user_id}/",
|
45
43
|
arguments,
|
46
|
-
|
44
|
+
nil,
|
47
45
|
headers
|
48
46
|
)
|
49
47
|
end
|
@@ -24,7 +24,7 @@ module Elastic
|
|
24
24
|
# Synonyms - Delete a synonym set
|
25
25
|
# Delete a synonym set
|
26
26
|
#
|
27
|
-
# @param
|
27
|
+
# @param [Hash] arguments endpoint arguments
|
28
28
|
# @option arguments [String] :synonym_set_id Synonym Set ID (*Required*)
|
29
29
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
30
|
#
|
@@ -33,15 +33,13 @@ module Elastic
|
|
33
33
|
def delete_synonym_set(arguments = {})
|
34
34
|
raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id]
|
35
35
|
|
36
|
-
synonym_set_id = arguments
|
37
|
-
|
36
|
+
synonym_set_id = arguments.delete(:synonym_set_id)
|
38
37
|
headers = arguments.delete(:headers) || {}
|
39
|
-
|
40
38
|
request(
|
41
39
|
:delete,
|
42
40
|
"api/ws/v1/synonyms/#{synonym_set_id}/",
|
43
41
|
arguments,
|
44
|
-
|
42
|
+
nil,
|
45
43
|
headers
|
46
44
|
)
|
47
45
|
end
|
@@ -24,8 +24,8 @@ module Elastic
|
|
24
24
|
# Documents - Retrieves a document by ID from the specified content source
|
25
25
|
# Retrieves a document by ID from the specified content source
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
27
|
+
# @param [String] content_source_id Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
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
|
#
|
@@ -35,15 +35,13 @@ module Elastic
|
|
35
35
|
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
36
36
|
raise ArgumentError, "Required parameter 'document_id' missing" unless arguments[:document_id]
|
37
37
|
|
38
|
-
document_id = arguments
|
39
|
-
|
38
|
+
document_id = arguments.delete(:document_id)
|
40
39
|
headers = arguments.delete(:headers) || {}
|
41
|
-
|
42
40
|
request(
|
43
41
|
:get,
|
44
42
|
"api/ws/v1/sources/#{content_source_id}/documents/#{document_id}/",
|
45
43
|
arguments,
|
46
|
-
|
44
|
+
nil,
|
47
45
|
headers
|
48
46
|
)
|
49
47
|
end
|