elastic-enterprise-search 7.17.1 → 8.0.0.pre
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.13.yml +12 -0
- data/.ci/jobs/elastic+enterprise-search-ruby+7.14.yml +12 -0
- 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 -3
- data/.rubocop.yml +1 -1
- data/README.md +1 -1
- data/docs/guide/app-search-api.asciidoc +15 -9
- data/docs/guide/overview.asciidoc +2 -2
- data/docs/guide/release_notes/712.asciidoc +10 -0
- data/docs/guide/release_notes/714.asciidoc +0 -12
- data/docs/guide/release_notes/715.asciidoc +0 -12
- data/docs/guide/release_notes/717.asciidoc +0 -12
- data/docs/guide/release_notes/80.asciidoc +14 -0
- data/docs/guide/release_notes/index.asciidoc +7 -0
- data/docs/guide/workplace-search-api.asciidoc +0 -3
- 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} +20 -14
- data/lib/elastic/app-search/api/add_meta_engine_source.rb +4 -5
- data/lib/elastic/app-search/api/api_key.rb +4 -6
- data/lib/elastic/app-search/api/api_logs.rb +8 -15
- data/lib/elastic/app-search/api/count_analytics.rb +5 -5
- data/lib/elastic/app-search/api/crawler_active_crawl_request.rb +4 -7
- data/lib/elastic/app-search/api/crawler_crawl_request.rb +6 -8
- data/lib/elastic/app-search/api/crawler_crawl_schedule.rb +4 -7
- data/lib/elastic/app-search/api/crawler_domain.rb +6 -8
- data/lib/elastic/app-search/api/crawler_domain_validation_result.rb +6 -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 +6 -8
- data/lib/elastic/app-search/api/crawler_process_crawl_denied_urls.rb +6 -8
- data/lib/elastic/app-search/api/crawler_url_extraction_result.rb +6 -6
- data/lib/elastic/app-search/api/crawler_url_tracing_result.rb +7 -7
- data/lib/elastic/app-search/api/crawler_url_validation_result.rb +7 -7
- data/lib/elastic/app-search/api/crawler_user_agent.rb +3 -6
- data/lib/elastic/app-search/api/create_api_key.rb +10 -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 +13 -11
- data/lib/elastic/app-search/api/create_crawler_domain.rb +8 -8
- data/lib/elastic/app-search/api/create_crawler_entry_point.rb +10 -8
- data/lib/elastic/app-search/api/create_crawler_process_crawl.rb +6 -6
- data/lib/elastic/app-search/api/create_crawler_sitemap.rb +10 -8
- data/lib/elastic/app-search/api/create_curation.rb +10 -8
- data/lib/elastic/app-search/api/create_engine.rb +8 -7
- data/lib/elastic/app-search/api/create_synonym_set.rb +6 -6
- data/lib/elastic/app-search/api/curation.rb +5 -7
- data/lib/elastic/app-search/api/delete_api_key.rb +4 -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 +7 -9
- data/lib/elastic/app-search/api/delete_crawler_crawl_schedule.rb +4 -7
- data/lib/elastic/app-search/api/delete_crawler_domain.rb +6 -8
- data/lib/elastic/app-search/api/delete_crawler_entry_point.rb +7 -9
- data/lib/elastic/app-search/api/delete_crawler_sitemap.rb +7 -9
- data/lib/elastic/app-search/api/delete_curation.rb +5 -7
- data/lib/elastic/app-search/api/delete_documents.rb +4 -5
- data/lib/elastic/app-search/api/delete_engine.rb +3 -6
- data/lib/elastic/app-search/api/delete_meta_engine_source.rb +4 -4
- data/lib/elastic/app-search/api/delete_synonym_set.rb +5 -7
- data/lib/elastic/app-search/api/documents.rb +5 -5
- data/lib/elastic/app-search/api/engine.rb +3 -6
- data/lib/elastic/app-search/api/index_documents.rb +4 -5
- data/lib/elastic/{workplace-search/api/remove_user_permissions.rb → app-search/api/list_adaptive_relevance_suggestions.rb} +13 -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 +9 -8
- data/lib/elastic/{workplace-search/api/put_user_permissions.rb → app-search/api/put_adaptive_relevance_settings.rb} +13 -14
- data/lib/elastic/app-search/api/put_adaptive_relevance_suggestions.rb +51 -0
- data/lib/elastic/app-search/api/put_api_key.rb +11 -10
- data/lib/elastic/app-search/api/put_crawler_crawl_rule.rb +14 -12
- data/lib/elastic/app-search/api/put_crawler_crawl_schedule.rb +8 -7
- data/lib/elastic/app-search/api/put_crawler_domain.rb +9 -9
- data/lib/elastic/app-search/api/put_crawler_entry_point.rb +11 -9
- data/lib/elastic/app-search/api/put_crawler_sitemap.rb +11 -9
- data/lib/elastic/app-search/api/put_curation.rb +11 -9
- data/lib/elastic/app-search/api/put_documents.rb +4 -4
- data/lib/elastic/app-search/api/put_schema.rb +4 -4
- data/lib/elastic/app-search/api/put_search_settings.rb +6 -6
- data/lib/elastic/app-search/api/put_synonym_set.rb +8 -8
- data/lib/elastic/app-search/api/query_suggestion.rb +5 -5
- data/lib/elastic/app-search/api/refresh_adaptive_relevance_update_process.rb +56 -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 +6 -5
- data/lib/elastic/app-search/api/search_settings.rb +3 -6
- data/lib/elastic/app-search/api/synonym_set.rb +5 -7
- data/lib/elastic/app-search/api/top_clicks_analytics.rb +5 -5
- data/lib/elastic/app-search/api/top_queries_analytics.rb +4 -4
- data/lib/elastic/enterprise-search/api/health.rb +2 -3
- data/lib/elastic/enterprise-search/api/put_read_only.rb +6 -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 +2 -13
- data/lib/elastic/enterprise-search/request.rb +6 -4
- 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/enterprise-search/request_spec.rb +1 -1
- data/spec/fixtures/vcr/workplace_search/create_analytics_event.yml +1 -1
- data/spec/fixtures/vcr/workplace_search/oauth_request_token.yml +1 -1
- data/spec/fixtures/vcr/workplace_search/search_request.yml +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
- metadata +28 -22
- 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,27 +24,28 @@ module Elastic
|
|
24
24
|
# ExternalIdentities - Updates an external identity
|
25
25
|
# Updates an external identity
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [String] :user
|
30
|
-
# @option arguments [Hash] :body
|
31
|
-
# @option body [
|
32
|
-
# @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 [String] :external_user_id Unique identifier of an external user, such as username or email address. (*Required*)
|
30
|
+
# @option arguments [Hash] :body (Required: external_user_id)
|
31
|
+
# @option body [string] :external_user_id
|
32
|
+
# @option body [["array", "null"]] :external_user_properties A list of external user properties, where each property is an object with an attribute_name and attribute_value.
|
33
|
+
# @option body [["array", "null"]] :permissions A list of user permissions.
|
33
34
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
34
35
|
#
|
35
36
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-external-identities-api.html#update-external-identity
|
36
37
|
#
|
37
38
|
def put_external_identity(content_source_id, arguments = {})
|
38
39
|
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
39
|
-
raise ArgumentError, "Required parameter '
|
40
|
+
raise ArgumentError, "Required parameter 'external_user_id' missing" unless arguments[:external_user_id]
|
41
|
+
raise ArgumentError, "Required parameter 'body (external_user_id)' missing" unless arguments[:body]
|
40
42
|
|
41
|
-
|
43
|
+
external_user_id = arguments.delete(:external_user_id)
|
42
44
|
body = arguments.delete(:body) || {}
|
43
45
|
headers = arguments.delete(:headers) || {}
|
44
|
-
|
45
46
|
request(
|
46
47
|
:put,
|
47
|
-
"api/ws/v1/sources/#{content_source_id}/external_identities/#{
|
48
|
+
"api/ws/v1/sources/#{content_source_id}/external_identities/#{external_user_id}/",
|
48
49
|
arguments,
|
49
50
|
body,
|
50
51
|
headers
|
@@ -24,21 +24,21 @@ module Elastic
|
|
24
24
|
# Synonyms - Update a synonym set
|
25
25
|
# Update 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
|
-
# @option arguments [Hash] :body
|
30
|
-
# @option body [Array] :synonyms A list of terms for this synonym set
|
29
|
+
# @option arguments [Hash] :body (Required: synonyms)
|
30
|
+
# @option body [Array<string>] :synonyms A list of terms for this synonym set
|
31
31
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
32
32
|
#
|
33
33
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-synonyms-api.html#update-synonym
|
34
34
|
#
|
35
35
|
def put_synonym_set(arguments = {})
|
36
36
|
raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id]
|
37
|
+
raise ArgumentError, "Required parameter 'body (synonyms)' missing" unless arguments[:body]
|
37
38
|
|
38
39
|
synonym_set_id = arguments.delete(:synonym_set_id)
|
39
40
|
body = arguments.delete(:body) || {}
|
40
41
|
headers = arguments.delete(:headers) || {}
|
41
|
-
|
42
42
|
request(
|
43
43
|
:put,
|
44
44
|
"api/ws/v1/synonyms/#{synonym_set_id}/",
|
@@ -21,23 +21,21 @@ module Elastic
|
|
21
21
|
module EnterpriseSearch
|
22
22
|
module WorkplaceSearch
|
23
23
|
module Actions
|
24
|
+
# putTriggersBlocklist - Update current triggers blocklist
|
24
25
|
# Update current triggers blocklist
|
25
26
|
#
|
26
|
-
# @param
|
27
|
-
# @option arguments [Hash] :body The request body
|
27
|
+
# @param [Hash] arguments endpoint arguments
|
28
28
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
29
29
|
#
|
30
30
|
# @see https://www.elastic.co/guide/en/workplace-search/current/automatic-query-refinement-blocklist.html
|
31
31
|
#
|
32
32
|
def put_triggers_blocklist(arguments = {})
|
33
|
-
body = arguments.delete(:body) || {}
|
34
33
|
headers = arguments.delete(:headers) || {}
|
35
|
-
|
36
34
|
request(
|
37
35
|
:put,
|
38
36
|
'api/ws/v1/automatic_query_refinement/',
|
39
37
|
arguments,
|
40
|
-
|
38
|
+
nil,
|
41
39
|
headers
|
42
40
|
)
|
43
41
|
end
|
@@ -24,31 +24,31 @@ module Elastic
|
|
24
24
|
# Search - Search across available sources with various query tuning options
|
25
25
|
# Issue a Search Query
|
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 [
|
27
|
+
# @param [Hash] arguments endpoint arguments
|
28
|
+
# @param [String] access_token OAuth Access Token (*Required*)
|
29
|
+
# @option arguments [Hash] :body *Required*
|
30
|
+
# @option body [string] :query A string or number used to find related documents
|
31
|
+
# @option body [boolean] :automatic_query_refinement Set to false to not automatically refine the query by keywords
|
32
|
+
# @option body [Hash] :page Paging controls for the result set
|
33
|
+
# @option body [Hash] :search_fields Restrict the fulltext search to only specific fields
|
34
|
+
# @option body [Hash] :result_fields Restrict the result fields for each item to the specified fields
|
35
35
|
# @option body :filters
|
36
36
|
# @option body :sort
|
37
|
-
# @option body [
|
38
|
-
# @option body [
|
37
|
+
# @option body [Hash] :facets
|
38
|
+
# @option body [Hash] :boosts
|
39
39
|
# @option body :source_type Optional parameter to search standard, remote only, or all available sources
|
40
|
-
# @option body [
|
41
|
-
# @option body [Array] :content_sources Optional list of content source ids to only return results from
|
40
|
+
# @option body [integer] :timeout Optional timeout in ms for searching remote sources
|
41
|
+
# @option body [Array<string>] :content_sources Optional list of content source ids to only return results from
|
42
42
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
43
43
|
#
|
44
44
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-search-api.html
|
45
45
|
#
|
46
46
|
def search(arguments = {})
|
47
47
|
raise ArgumentError, "Required parameter 'access_token' missing" unless arguments[:access_token]
|
48
|
+
raise ArgumentError, "Required parameter 'body' missing" unless arguments[:body]
|
48
49
|
|
49
50
|
body = arguments.delete(:body) || {}
|
50
51
|
headers = arguments.delete(:headers) || {}
|
51
|
-
|
52
52
|
request(
|
53
53
|
:post,
|
54
54
|
'api/ws/v1/search/',
|
@@ -24,7 +24,7 @@ module Elastic
|
|
24
24
|
# Synonyms - Retrieve a synonym set by ID
|
25
25
|
# Retrieve a synonym set by ID
|
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 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
|
:get,
|
42
40
|
"api/ws/v1/synonyms/#{synonym_set_id}/",
|
43
41
|
arguments,
|
44
|
-
|
42
|
+
nil,
|
45
43
|
headers
|
46
44
|
)
|
47
45
|
end
|
@@ -21,21 +21,21 @@ module Elastic
|
|
21
21
|
module EnterpriseSearch
|
22
22
|
module WorkplaceSearch
|
23
23
|
module Actions
|
24
|
+
# getTriggersBlocklist - Get current triggers blocklist
|
24
25
|
# Get current triggers blocklist
|
25
26
|
#
|
26
|
-
# @param
|
27
|
+
# @param [Hash] arguments endpoint arguments
|
27
28
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
28
29
|
#
|
29
30
|
# @see https://www.elastic.co/guide/en/workplace-search/current/automatic-query-refinement-blocklist.html
|
30
31
|
#
|
31
32
|
def triggers_blocklist(arguments = {})
|
32
33
|
headers = arguments.delete(:headers) || {}
|
33
|
-
|
34
34
|
request(
|
35
35
|
:get,
|
36
36
|
'api/ws/v1/automatic_query_refinement/',
|
37
37
|
arguments,
|
38
|
-
|
38
|
+
nil,
|
39
39
|
headers
|
40
40
|
)
|
41
41
|
end
|
@@ -32,7 +32,7 @@ describe Elastic::EnterpriseSearch::Client do
|
|
32
32
|
"(RUBY_VERSION: #{RUBY_VERSION}; ",
|
33
33
|
"#{RbConfig::CONFIG['host_os'].split('_').first[/[a-z]+/i].downcase} ",
|
34
34
|
"#{RbConfig::CONFIG['target_cpu']}; ",
|
35
|
-
"
|
35
|
+
"elastic-transport: #{Elastic::Transport::VERSION})"
|
36
36
|
].join
|
37
37
|
end
|
38
38
|
|
@@ -10,7 +10,7 @@ http_interactions:
|
|
10
10
|
X-Elastic-Client-Meta:
|
11
11
|
- es=7.11.0.pre.1,rb=2.7.2,t=7.11.0.pre.1,fd=1.3.0,nh=1.1
|
12
12
|
User-Agent:
|
13
|
-
- 'elastic-
|
13
|
+
- 'elastic-enteprise-search-ruby/7.11.0.pre (RUBY_VERSION: 2.7.2; linux x86_64;
|
14
14
|
elasticsearch-transport: 7.11.0.pre.1)'
|
15
15
|
Content-Type:
|
16
16
|
- application/json
|
@@ -10,7 +10,7 @@ http_interactions:
|
|
10
10
|
X-Elastic-Client-Meta:
|
11
11
|
- es=7.11.0.pre.1,rb=2.7.2,t=7.11.0.pre.1,fd=1.3.0,nh=1.1
|
12
12
|
User-Agent:
|
13
|
-
- 'elastic-
|
13
|
+
- 'elastic-enteprise-search-ruby/7.11.0.pre (RUBY_VERSION: 2.7.2; linux x86_64;
|
14
14
|
elasticsearch-transport: 7.11.0.pre.1)'
|
15
15
|
Content-Type:
|
16
16
|
- application/json
|
@@ -10,7 +10,7 @@ http_interactions:
|
|
10
10
|
X-Elastic-Client-Meta:
|
11
11
|
- es=7.11.0.pre.1,rb=2.7.2,t=7.11.0.pre.1,fd=1.3.0,nh=1.1
|
12
12
|
User-Agent:
|
13
|
-
- 'elastic-
|
13
|
+
- 'elastic-enteprise-search-ruby/7.11.0.pre (RUBY_VERSION: 2.7.2; linux x86_64;
|
14
14
|
elasticsearch-transport: 7.11.0.pre.1)'
|
15
15
|
Content-Type:
|
16
16
|
- application/json
|
@@ -0,0 +1,60 @@
|
|
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
|
+
require_relative "#{__dir__}/app_search_helper.rb"
|
21
|
+
|
22
|
+
describe Elastic::EnterpriseSearch::AppSearch::Client do
|
23
|
+
context 'Adaptive Relevance Settings' do
|
24
|
+
let(:engine_name) { 'relevance-settings' }
|
25
|
+
|
26
|
+
before do
|
27
|
+
create_engine(engine_name)
|
28
|
+
client.put_adaptive_relevance_settings(engine_name, body: { curation: { enabled: true } })
|
29
|
+
end
|
30
|
+
|
31
|
+
after do
|
32
|
+
delete_engines
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'Shows the settings for an engine' do
|
36
|
+
response = client.adaptive_relevance_settings(engine_name)
|
37
|
+
|
38
|
+
expect(response.status).to eq 200
|
39
|
+
expect(response.body['curation'])
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'Updates relevance settings' do
|
43
|
+
body = {
|
44
|
+
curation: { enabled: true }
|
45
|
+
}
|
46
|
+
response = client.put_adaptive_relevance_settings(engine_name, body: body)
|
47
|
+
expect(response.status).to eq 200
|
48
|
+
expect(response.body['curation']['enabled'])
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'Refreshes adaptive relevance update process' do
|
52
|
+
response = client.refresh_adaptive_relevance_update_process(
|
53
|
+
engine_name,
|
54
|
+
adaptive_relevance_suggestion_type: 'curation'
|
55
|
+
)
|
56
|
+
expect(response.status).to eq 200
|
57
|
+
expect(response.body['process']['type']).to eq 'curation'
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,54 @@
|
|
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
|
+
require_relative "#{__dir__}/app_search_helper.rb"
|
21
|
+
|
22
|
+
describe Elastic::EnterpriseSearch::AppSearch::Client do
|
23
|
+
context 'Adaptive Relevance Suggestions' do
|
24
|
+
let(:engine_name) { 'relevance-suggestions' }
|
25
|
+
|
26
|
+
before do
|
27
|
+
create_engine(engine_name)
|
28
|
+
client.put_adaptive_relevance_settings(engine_name, body: { curation: { enabled: true } })
|
29
|
+
end
|
30
|
+
|
31
|
+
after do
|
32
|
+
delete_engines
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'Updates an adaptive relevance suggestion' do
|
36
|
+
body = [{ query: 'forest', type: 'curation', status: 'applied' }]
|
37
|
+
response = client.put_adaptive_relevance_suggestions(engine_name, body: body)
|
38
|
+
expect(response.status).to eq 200
|
39
|
+
expect(response.body['results'].first.keys).to include('query', 'type', 'status')
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'Retrieves an adaptive relevance suggestion' do
|
43
|
+
expect do
|
44
|
+
client.adaptive_relevance_suggestions(engine_name, search_suggestion_query: 'test')
|
45
|
+
end.to raise_error(Elastic::Transport::Transport::Errors::NotFound)
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'Lists adaptive relevance suggestions' do
|
49
|
+
response = client.list_adaptive_relevance_suggestions(engine_name)
|
50
|
+
expect(response.status).to eq 200
|
51
|
+
expect(response.body)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -21,7 +21,7 @@ require_relative "#{__dir__}/app_search_helper.rb"
|
|
21
21
|
|
22
22
|
describe Elastic::EnterpriseSearch::AppSearch::Client do
|
23
23
|
context 'API logs' do
|
24
|
-
let(:engine_name) { '
|
24
|
+
let(:engine_name) { 'api-logs' }
|
25
25
|
let(:api_key_name) { 'logs-api-key' }
|
26
26
|
|
27
27
|
before do
|
@@ -44,14 +44,22 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'returns api logs' do
|
47
|
-
|
47
|
+
body = {
|
48
|
+
filters: {
|
49
|
+
date: {
|
50
|
+
from: client.date_to_rfc3339(Date.today - 1),
|
51
|
+
to: client.date_to_rfc3339(Date.today + 1)
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
response = client.api_logs(engine_name, body: body)
|
48
56
|
expect(response.status).to eq 200
|
49
57
|
|
50
58
|
attempts = 0
|
51
59
|
while response.body['results'].count < 1 && attempts < 20
|
52
60
|
sleep 1
|
53
61
|
attempts += 1
|
54
|
-
response = client.api_logs(engine_name,
|
62
|
+
response = client.api_logs(engine_name, body: body)
|
55
63
|
end
|
56
64
|
expect(response.body['results'].count).to be >= 1
|
57
65
|
end
|
@@ -41,8 +41,8 @@ def delete_engines
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def create_engine(name)
|
44
|
-
client.create_engine(name: name)
|
45
|
-
rescue
|
44
|
+
client.create_engine({ body: { name: name } })
|
45
|
+
rescue Elastic::Transport::Transport::Errors::BadRequest => e
|
46
46
|
raise e unless e.message.match(/Name is already taken/)
|
47
47
|
|
48
48
|
Logger.new($stdout).info("Engine '#{name}' had already been created, giving time for the server to sync.")
|
@@ -35,13 +35,14 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
35
35
|
response = client.count_analytics(engine_name)
|
36
36
|
|
37
37
|
expect(response.status).to eq 200
|
38
|
-
|
38
|
+
|
39
|
+
expect(response.body['results'])
|
39
40
|
end
|
40
41
|
|
41
42
|
it 'returns count analytics with filters' do
|
42
43
|
response = client.count_analytics(engine_name, body: { filters: { tag: 'web' } })
|
43
44
|
expect(response.status).to eq 200
|
44
|
-
expect(response.body['results']
|
45
|
+
expect(response.body['results'])
|
45
46
|
end
|
46
47
|
end
|
47
48
|
end
|
@@ -68,6 +68,22 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
68
68
|
expect(response.body).to include('name' => new_name)
|
69
69
|
end
|
70
70
|
|
71
|
+
it 'creates and lists crawler domains' do
|
72
|
+
body = { name: name }
|
73
|
+
response = client.create_crawler_domain(engine_name, body: body)
|
74
|
+
@domain = response.body
|
75
|
+
|
76
|
+
expect(response.status).to eq 200
|
77
|
+
expect(response.body['id']).to eq @domain['id']
|
78
|
+
expect(response.body).to include('name' => name)
|
79
|
+
|
80
|
+
response = client.list_crawler_domains(engine_name)
|
81
|
+
expect(response.status).to eq 200
|
82
|
+
|
83
|
+
expect(response.body['results'].count).to eq 1
|
84
|
+
expect(response.body['results'].first['name']).to eq name
|
85
|
+
end
|
86
|
+
|
71
87
|
it 'validates a domain' do
|
72
88
|
body = { name: name }
|
73
89
|
@domain = client.create_crawler_domain(engine_name, body: body).body
|
@@ -44,7 +44,7 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
44
44
|
expect(response.status).to eq 200
|
45
45
|
expect(response.body['id']).to match(/cur-[0-9a-f]+/)
|
46
46
|
|
47
|
-
response = client.search(engine_name, query: 'jungle')
|
47
|
+
response = client.search(engine_name, body: { query: 'jungle' })
|
48
48
|
expect(response.status).to eq 200
|
49
49
|
expect(response.body['results'].count).to eq 1
|
50
50
|
expect(response.body['results'].first['title']['raw']).to eq 'Jungle Tales'
|
@@ -65,9 +65,11 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
65
65
|
def create_curation(name, query, promoted_id, hidden_id)
|
66
66
|
response = client.create_curation(
|
67
67
|
name,
|
68
|
-
|
69
|
-
|
70
|
-
|
68
|
+
body: {
|
69
|
+
queries: [query],
|
70
|
+
promoted: [promoted_id],
|
71
|
+
hidden: [hidden_id]
|
72
|
+
}
|
71
73
|
)
|
72
74
|
# Give the server a second
|
73
75
|
sleep 1
|
@@ -79,16 +81,20 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
79
81
|
|
80
82
|
response = client.put_curation(
|
81
83
|
engine_name,
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
84
|
+
{
|
85
|
+
curation_id: id,
|
86
|
+
body: {
|
87
|
+
queries: ['jungle'],
|
88
|
+
promoted: [@hidden['id']],
|
89
|
+
hidden: [@promoted['id']]
|
90
|
+
}
|
91
|
+
}
|
86
92
|
)
|
87
93
|
|
88
94
|
expect(response.status).to eq 200
|
89
95
|
expect(response.body['id']).to match(/cur-[0-9a-f]+/)
|
90
96
|
|
91
|
-
response = @client.search(engine_name, query: 'jungle')
|
97
|
+
response = @client.search(engine_name, body: { query: 'jungle' })
|
92
98
|
expect(response.status).to eq 200
|
93
99
|
expect(response.body['results'].count).to eq 1
|
94
100
|
expect(response.body['results'].first['title']['raw']).to eq 'The Jungle Book'
|
@@ -22,54 +22,52 @@ require_relative "#{__dir__}/app_search_helper.rb"
|
|
22
22
|
describe Elastic::EnterpriseSearch::AppSearch::Client do
|
23
23
|
context 'Engines' do
|
24
24
|
let(:engine_name) { 'test-create-engines' }
|
25
|
+
let(:engine_response) do
|
26
|
+
{
|
27
|
+
'type' => 'default',
|
28
|
+
'language' => nil,
|
29
|
+
'document_count' => 0,
|
30
|
+
'index_create_settings_override' => {}
|
31
|
+
}
|
32
|
+
end
|
25
33
|
|
26
34
|
after do
|
27
35
|
delete_engines
|
28
36
|
end
|
29
37
|
|
30
38
|
it 'creates a new engine' do
|
31
|
-
response = client.create_engine(name: engine_name)
|
39
|
+
response = client.create_engine({ body: { name: engine_name } })
|
32
40
|
|
33
41
|
expect(response.status).to eq 200
|
34
|
-
expect(response.body).to eq(
|
35
|
-
{
|
36
|
-
'name' => engine_name,
|
37
|
-
'type' => 'default',
|
38
|
-
'language' => nil,
|
39
|
-
'document_count' => 0
|
40
|
-
}
|
41
|
-
)
|
42
|
+
expect(response.body).to eq(engine_response.merge({ 'name' => engine_name }))
|
42
43
|
end
|
43
44
|
|
44
45
|
it 'lists engines' do
|
45
|
-
client.create_engine(name: 'engine1')
|
46
|
-
client.create_engine(name: 'engine2')
|
46
|
+
client.create_engine({ body: { name: 'engine1' } })
|
47
|
+
client.create_engine({ body: { name: 'engine2' } })
|
47
48
|
|
48
49
|
response = client.list_engines
|
49
50
|
expect(response.status).to eq 200
|
50
51
|
|
51
52
|
expect(response.body.dig('meta', 'page', 'total_results')).to eq 2
|
52
|
-
expect(response.body['results']).to include(
|
53
|
-
|
54
|
-
)
|
55
|
-
expect(response.body['results']).to include(
|
56
|
-
{ 'name' => 'engine2', 'type' => 'default', 'language' => nil, 'document_count' => 0 }
|
57
|
-
)
|
53
|
+
expect(response.body['results']).to include(engine_response.merge({ 'name' => 'engine1' }))
|
54
|
+
expect(response.body['results']).to include(engine_response.merge({ 'name' => 'engine2' }))
|
58
55
|
end
|
59
56
|
|
60
|
-
|
61
|
-
engine_name
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
57
|
+
context 'get engines' do
|
58
|
+
let(:engine_name) { 'retrieve-engine' }
|
59
|
+
it 'retrieves an engine by name' do
|
60
|
+
engine_name = 'retrieve-engine'
|
61
|
+
client.create_engine({ body: { name: engine_name } })
|
62
|
+
response = client.engine(engine_name)
|
63
|
+
expect(response.status).to eq 200
|
64
|
+
expect(response.body).to eq(engine_response.merge({ 'name' => engine_name }))
|
65
|
+
end
|
68
66
|
end
|
69
67
|
|
70
68
|
it 'deletes an engine' do
|
71
69
|
engine_name = 'delete-engine'
|
72
|
-
client.create_engine(name: engine_name)
|
70
|
+
client.create_engine({ body: { name: engine_name } })
|
73
71
|
response = client.delete_engine(engine_name)
|
74
72
|
expect(response.status).to eq 200
|
75
73
|
expect(response.body).to eq({ 'deleted' => true })
|
@@ -21,7 +21,7 @@ require_relative "#{__dir__}/app_search_helper.rb"
|
|
21
21
|
|
22
22
|
describe Elastic::EnterpriseSearch::AppSearch::Client do
|
23
23
|
context 'Log Click through' do
|
24
|
-
let(:engine_name) { '
|
24
|
+
let(:engine_name) { 'log-click-through' }
|
25
25
|
|
26
26
|
before do
|
27
27
|
create_engine(engine_name)
|
@@ -28,12 +28,12 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
28
28
|
type: 'meta',
|
29
29
|
source_engines: ['books', 'videogames']
|
30
30
|
}
|
31
|
-
client.create_engine(
|
31
|
+
client.create_engine(body: body)
|
32
32
|
end
|
33
33
|
|
34
34
|
before do
|
35
|
-
client.create_engine(name: 'books')
|
36
|
-
client.create_engine(name: 'videogames')
|
35
|
+
client.create_engine({ body: { name: 'books' } })
|
36
|
+
client.create_engine({ body: { name: 'videogames' } })
|
37
37
|
end
|
38
38
|
|
39
39
|
after do
|
@@ -51,7 +51,7 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
51
51
|
it 'adds a new source engine to a meta engine' do
|
52
52
|
create_meta_engine
|
53
53
|
# Create new source engine to add:
|
54
|
-
client.create_engine(name: 'add-source')
|
54
|
+
client.create_engine({ body: { name: 'add-source' } })
|
55
55
|
response = client.add_meta_engine_source(engine_name, source_engines: ['add-source'])
|
56
56
|
|
57
57
|
expect(response.status).to eq 200
|
@@ -62,7 +62,7 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
62
62
|
|
63
63
|
it 'removes a source engine from a meta engine' do
|
64
64
|
create_meta_engine
|
65
|
-
client.create_engine(name: 'remove-source')
|
65
|
+
client.create_engine({ body: { name: 'remove-source' } })
|
66
66
|
client.add_meta_engine_source(engine_name, source_engines: ['remove-source'])
|
67
67
|
response = client.delete_meta_engine_source(engine_name, source_engines: ['remove-source'])
|
68
68
|
|
@@ -44,7 +44,7 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
44
44
|
|
45
45
|
context 'search' do
|
46
46
|
it 'performs a single query search' do
|
47
|
-
response = client.search(engine_name, query: 'Ibarbourou')
|
47
|
+
response = client.search(engine_name, body: { query: 'Ibarbourou' })
|
48
48
|
expect(response.status).to eq 200
|
49
49
|
expect(response.body).not_to be nil
|
50
50
|
expect(response.body['results'].count).to be 1
|