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,14 +24,15 @@ module Elastic
|
|
24
24
|
# Curations - Update a curation
|
25
25
|
# Updates an existing curation
|
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 [String] :curation_id Curation ID (*Required*)
|
30
|
-
# @option arguments [Hash] :body
|
31
|
-
# @option body [
|
32
|
-
# @option body [Array] :queries List of affected search queries
|
33
|
-
# @option body [Array] :promoted List of promoted document IDs
|
34
|
-
# @option body [Array] :hidden List of hidden document IDs
|
30
|
+
# @option arguments [Hash] :body (Required: queries)
|
31
|
+
# @option body [string] :id
|
32
|
+
# @option body [Array<string>] :queries List of affected search queries
|
33
|
+
# @option body [Array<string>] :promoted List of promoted document IDs
|
34
|
+
# @option body [Array<string>] :hidden List of hidden document IDs
|
35
|
+
# @option body [Hash] :suggestion
|
35
36
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
36
37
|
#
|
37
38
|
# @see https://www.elastic.co/guide/en/app-search/current/curations.html#curations-update
|
@@ -39,11 +40,12 @@ module Elastic
|
|
39
40
|
def put_curation(engine_name, arguments = {})
|
40
41
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
41
42
|
raise ArgumentError, "Required parameter 'curation_id' missing" unless arguments[:curation_id]
|
43
|
+
raise ArgumentError, "Required parameter 'body (queries)' missing" unless arguments[:body]
|
42
44
|
|
43
|
-
curation_id = arguments
|
45
|
+
curation_id = arguments.delete(:curation_id)
|
44
46
|
body = arguments.delete(:body) || {}
|
45
|
-
headers = arguments.delete(:headers) || {}
|
46
47
|
|
48
|
+
headers = arguments.delete(:headers) || {}
|
47
49
|
request(
|
48
50
|
:put,
|
49
51
|
"api/as/v1/engines/#{engine_name}/curations/#{curation_id}/",
|
@@ -24,9 +24,9 @@ module Elastic
|
|
24
24
|
# Documents - Partial update of documents
|
25
25
|
# Update specific document fields by id and field
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [Array] :documents
|
27
|
+
# @param [String] engine_name Name of the engine (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
|
+
# @option arguments [Array<Hash> { id: [string] }] :documents
|
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/app-search/current/documents.html#documents-partial
|
@@ -35,8 +35,8 @@ module Elastic
|
|
35
35
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
36
36
|
|
37
37
|
documents = arguments.delete(:documents) || {}
|
38
|
-
headers = arguments.delete(:headers) || {}
|
39
38
|
|
39
|
+
headers = arguments.delete(:headers) || {}
|
40
40
|
request(
|
41
41
|
:patch,
|
42
42
|
"api/as/v1/engines/#{engine_name}/documents/",
|
@@ -24,9 +24,9 @@ module Elastic
|
|
24
24
|
# Schema - Update engine schema
|
25
25
|
# Update schema for the current engine
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [
|
27
|
+
# @param [String] engine_name Name of the engine (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
|
+
# @option arguments [Hash] :schema
|
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/app-search/current/schema.html#schema-patch
|
@@ -35,8 +35,8 @@ module Elastic
|
|
35
35
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
36
36
|
|
37
37
|
schema = arguments.delete(:schema) || {}
|
38
|
-
headers = arguments.delete(:headers) || {}
|
39
38
|
|
39
|
+
headers = arguments.delete(:headers) || {}
|
40
40
|
request(
|
41
41
|
:post,
|
42
42
|
"api/as/v1/engines/#{engine_name}/schema/",
|
@@ -21,26 +21,26 @@ module Elastic
|
|
21
21
|
module EnterpriseSearch
|
22
22
|
module AppSearch
|
23
23
|
module Actions
|
24
|
-
#
|
24
|
+
# Synonyms - Update search settings
|
25
|
+
# Updates search settings for the engine
|
25
26
|
#
|
26
|
-
# @param
|
27
|
-
# @param
|
27
|
+
# @param [String] engine_name Name of the engine (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
28
29
|
# @option arguments [Hash] :body
|
29
30
|
# @option body :boosts
|
30
31
|
# @option body :search_fields
|
31
32
|
# @option body :result_fields
|
32
|
-
# @option body [
|
33
|
+
# @option body [integer] :precision
|
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/app-search/current/search-settings.html#search-settings-update
|
36
37
|
#
|
37
38
|
def put_search_settings(engine_name, arguments = {})
|
38
39
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
39
|
-
raise ArgumentError, "Required parameter 'body' missing" unless arguments[:body]
|
40
40
|
|
41
41
|
body = arguments.delete(:body) || {}
|
42
|
-
headers = arguments.delete(:headers) || {}
|
43
42
|
|
43
|
+
headers = arguments.delete(:headers) || {}
|
44
44
|
request(
|
45
45
|
:put,
|
46
46
|
"api/as/v1/engines/#{engine_name}/search_settings/",
|
@@ -24,12 +24,12 @@ module Elastic
|
|
24
24
|
# Synonyms - Update a synonym set
|
25
25
|
# Updates a synonym set by ID
|
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 [String] :synonym_set_id Synonym Set ID (*Required*)
|
30
|
-
# @option arguments [Hash] :body
|
31
|
-
# @option body [
|
32
|
-
# @option body :synonyms
|
30
|
+
# @option arguments [Hash] :body (Required: synonyms)
|
31
|
+
# @option body [string] :id
|
32
|
+
# @option body :synonyms
|
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/app-search/current/synonyms.html#synonyms-update
|
@@ -37,12 +37,12 @@ module Elastic
|
|
37
37
|
def put_synonym_set(engine_name, arguments = {})
|
38
38
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
39
39
|
raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id]
|
40
|
-
raise ArgumentError, "Required parameter 'body (synonyms)' missing" unless arguments[:body]
|
40
|
+
raise ArgumentError, "Required parameter 'body (synonyms)' missing" unless arguments[:body]
|
41
41
|
|
42
|
-
synonym_set_id = arguments
|
42
|
+
synonym_set_id = arguments.delete(:synonym_set_id)
|
43
43
|
body = arguments.delete(:body) || {}
|
44
|
-
headers = arguments.delete(:headers) || {}
|
45
44
|
|
45
|
+
headers = arguments.delete(:headers) || {}
|
46
46
|
request(
|
47
47
|
:put,
|
48
48
|
"api/as/v1/engines/#{engine_name}/synonyms/#{synonym_set_id}/",
|
@@ -24,12 +24,12 @@ module Elastic
|
|
24
24
|
# QuerySuggestion - Retrieve query suggestions
|
25
25
|
# Provide relevant query suggestions for incomplete queries
|
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
|
-
# @option body [
|
30
|
+
# @option body [string] :query
|
31
31
|
# @option body :types
|
32
|
-
# @option body [
|
32
|
+
# @option body [integer] :size
|
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/app-search/current/query-suggestion.html
|
@@ -38,8 +38,8 @@ module Elastic
|
|
38
38
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
39
39
|
|
40
40
|
body = arguments.delete(:body) || {}
|
41
|
-
headers = arguments.delete(:headers) || {}
|
42
41
|
|
42
|
+
headers = arguments.delete(:headers) || {}
|
43
43
|
request(
|
44
44
|
:post,
|
45
45
|
"api/as/v1/engines/#{engine_name}/query_suggestion/",
|
@@ -0,0 +1,56 @@
|
|
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 AppSearch
|
23
|
+
module Actions
|
24
|
+
# AdaptiveRelevanceSettings - Retrieve adaptive relevance settings
|
25
|
+
# Update suggestions process refresh
|
26
|
+
#
|
27
|
+
# @param [String] engine_name Name of the engine (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
|
+
# @option arguments [String] :adaptive_relevance_suggestion_type Adaptive relevance suggestion type (*Required*)
|
30
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
|
+
#
|
32
|
+
# @see https://www.elastic.co/guide/en/app-search/current/adaptive-relevance-api-reference.html#adaptive-relevance-api-post-engine-adaptive-relevance-suggestions-update-process-refresh
|
33
|
+
#
|
34
|
+
def refresh_adaptive_relevance_update_process(engine_name, arguments = {})
|
35
|
+
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
36
|
+
|
37
|
+
unless arguments[:adaptive_relevance_suggestion_type]
|
38
|
+
raise ArgumentError,
|
39
|
+
"Required parameter 'adaptive_relevance_suggestion_type' missing"
|
40
|
+
end
|
41
|
+
|
42
|
+
adaptive_relevance_suggestion_type = arguments.delete(:adaptive_relevance_suggestion_type)
|
43
|
+
|
44
|
+
headers = arguments.delete(:headers) || {}
|
45
|
+
request(
|
46
|
+
:post,
|
47
|
+
"api/as/v0/engines/#{engine_name}/adaptive_relevance/update_process/#{adaptive_relevance_suggestion_type}/refresh/",
|
48
|
+
arguments,
|
49
|
+
nil,
|
50
|
+
headers
|
51
|
+
)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -24,9 +24,8 @@ module Elastic
|
|
24
24
|
# Synonyms - Reset search settings
|
25
25
|
# Resets search settings for the engine
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [Hash] :body The request body
|
27
|
+
# @param [String] engine_name Name of the engine (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
30
29
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
30
|
#
|
32
31
|
# @see https://www.elastic.co/guide/en/app-search/current/search-settings.html#search-settings-reset
|
@@ -34,14 +33,12 @@ module Elastic
|
|
34
33
|
def reset_search_settings(engine_name, arguments = {})
|
35
34
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
36
35
|
|
37
|
-
body = arguments.delete(:body) || {}
|
38
36
|
headers = arguments.delete(:headers) || {}
|
39
|
-
|
40
37
|
request(
|
41
38
|
:post,
|
42
39
|
"api/as/v1/engines/#{engine_name}/search_settings/reset/",
|
43
40
|
arguments,
|
44
|
-
|
41
|
+
nil,
|
45
42
|
headers
|
46
43
|
)
|
47
44
|
end
|
@@ -24,9 +24,8 @@ module Elastic
|
|
24
24
|
# Schema - Retrieve engine schema
|
25
25
|
# Retrieve current schema for the engine
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [Hash] :body The request body
|
27
|
+
# @param [String] engine_name Name of the engine (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
30
29
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
30
|
#
|
32
31
|
# @see https://www.elastic.co/guide/en/app-search/current/schema.html#schema-read
|
@@ -34,14 +33,12 @@ module Elastic
|
|
34
33
|
def schema(engine_name, arguments = {})
|
35
34
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
36
35
|
|
37
|
-
body = arguments.delete(:body) || {}
|
38
36
|
headers = arguments.delete(:headers) || {}
|
39
|
-
|
40
37
|
request(
|
41
38
|
:get,
|
42
39
|
"api/as/v1/engines/#{engine_name}/schema/",
|
43
40
|
arguments,
|
44
|
-
|
41
|
+
nil,
|
45
42
|
headers
|
46
43
|
)
|
47
44
|
end
|
@@ -24,10 +24,10 @@ module Elastic
|
|
24
24
|
# Search - Submit a search
|
25
25
|
# Submit a search and receive a set of results with meta data
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [Hash] :body
|
30
|
-
# @option body [
|
27
|
+
# @param [String] engine_name Name of the engine (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
|
+
# @option arguments [Hash] :body (Required: query)
|
30
|
+
# @option body [string] :query
|
31
31
|
# @option body :analytics
|
32
32
|
# @option body :boost
|
33
33
|
# @option body :facets
|
@@ -43,10 +43,11 @@ module Elastic
|
|
43
43
|
#
|
44
44
|
def search(engine_name, arguments = {})
|
45
45
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
46
|
+
raise ArgumentError, "Required parameter 'body (query)' missing" unless arguments[:body]
|
46
47
|
|
47
48
|
body = arguments.delete(:body) || {}
|
48
|
-
headers = arguments.delete(:headers) || {}
|
49
49
|
|
50
|
+
headers = arguments.delete(:headers) || {}
|
50
51
|
request(
|
51
52
|
:post,
|
52
53
|
"api/as/v1/engines/#{engine_name}/search/",
|
@@ -24,9 +24,8 @@ module Elastic
|
|
24
24
|
# SearchSettings - Retrieve search settings
|
25
25
|
# Retrieve current search settings for the engine
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [Hash] :body The request body
|
27
|
+
# @param [String] engine_name Name of the engine (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
30
29
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
30
|
#
|
32
31
|
# @see https://www.elastic.co/guide/en/app-search/current/search-settings.html#search-settings-show
|
@@ -34,14 +33,12 @@ module Elastic
|
|
34
33
|
def search_settings(engine_name, arguments = {})
|
35
34
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
36
35
|
|
37
|
-
body = arguments.delete(:body) || {}
|
38
36
|
headers = arguments.delete(:headers) || {}
|
39
|
-
|
40
37
|
request(
|
41
38
|
:get,
|
42
39
|
"api/as/v1/engines/#{engine_name}/search_settings/",
|
43
40
|
arguments,
|
44
|
-
|
41
|
+
nil,
|
45
42
|
headers
|
46
43
|
)
|
47
44
|
end
|
@@ -24,10 +24,9 @@ module Elastic
|
|
24
24
|
# Synonyms - Retrieve a synonym set
|
25
25
|
# Retrieves a synonym set by ID
|
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 [String] :synonym_set_id Synonym Set ID (*Required*)
|
30
|
-
# @option arguments [Hash] :body The request body
|
31
30
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
32
31
|
#
|
33
32
|
# @see https://www.elastic.co/guide/en/app-search/current/synonyms.html#synonyms-list-one
|
@@ -36,15 +35,14 @@ module Elastic
|
|
36
35
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
37
36
|
raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id]
|
38
37
|
|
39
|
-
synonym_set_id = arguments
|
40
|
-
body = arguments.delete(:body) || {}
|
41
|
-
headers = arguments.delete(:headers) || {}
|
38
|
+
synonym_set_id = arguments.delete(:synonym_set_id)
|
42
39
|
|
40
|
+
headers = arguments.delete(:headers) || {}
|
43
41
|
request(
|
44
42
|
:get,
|
45
43
|
"api/as/v1/engines/#{engine_name}/synonyms/#{synonym_set_id}/",
|
46
44
|
arguments,
|
47
|
-
|
45
|
+
nil,
|
48
46
|
headers
|
49
47
|
)
|
50
48
|
end
|
@@ -24,12 +24,12 @@ module Elastic
|
|
24
24
|
# Analytics - Query for analytics click data
|
25
25
|
# Returns the number of clicks received by a document in descending order
|
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
|
-
# @option body [
|
30
|
+
# @option body [string] :query
|
31
31
|
# @option body :filters
|
32
|
-
# @option body [
|
32
|
+
# @option body [Hash] :page (Required: size)
|
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/app-search/current/clicks.html
|
@@ -38,8 +38,8 @@ module Elastic
|
|
38
38
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
39
39
|
|
40
40
|
body = arguments.delete(:body) || {}
|
41
|
-
headers = arguments.delete(:headers) || {}
|
42
41
|
|
42
|
+
headers = arguments.delete(:headers) || {}
|
43
43
|
request(
|
44
44
|
:post,
|
45
45
|
"api/as/v1/engines/#{engine_name}/analytics/clicks/",
|
@@ -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
|
@@ -37,8 +37,8 @@ module Elastic
|
|
37
37
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
38
38
|
|
39
39
|
body = arguments.delete(:body) || {}
|
40
|
-
headers = arguments.delete(:headers) || {}
|
41
40
|
|
41
|
+
headers = arguments.delete(:headers) || {}
|
42
42
|
request(
|
43
43
|
:post,
|
44
44
|
"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,19 @@ 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
|
-
headers = arguments.delete(:headers) || {}
|
36
37
|
|
38
|
+
headers = arguments.delete(:headers) || {}
|
37
39
|
request(
|
38
40
|
:put,
|
39
41
|
'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
|
@@ -68,7 +68,7 @@ module Elastic
|
|
68
68
|
|
69
69
|
def transport
|
70
70
|
@options[:transport] ||
|
71
|
-
|
71
|
+
Elastic::Transport::Client.new(
|
72
72
|
host: host,
|
73
73
|
log: log,
|
74
74
|
logger: logger,
|
@@ -116,17 +116,6 @@ module Elastic
|
|
116
116
|
|
117
117
|
@options[:host]
|
118
118
|
end
|
119
|
-
|
120
|
-
private
|
121
|
-
|
122
|
-
def transport_klass
|
123
|
-
case Elasticsearch::Transport::VERSION
|
124
|
-
when /7\.1[123]/
|
125
|
-
Elasticsearch::Client
|
126
|
-
else
|
127
|
-
Elasticsearch::Transport::Client
|
128
|
-
end
|
129
|
-
end
|
130
119
|
end
|
131
120
|
end
|
132
121
|
end
|
@@ -19,12 +19,13 @@
|
|
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
|
|
25
26
|
module Elastic
|
26
27
|
module EnterpriseSearch
|
27
|
-
CLIENT_NAME = 'elastic-
|
28
|
+
CLIENT_NAME = 'elastic-enteprise-search-ruby'
|
28
29
|
CLIENT_VERSION = Elastic::EnterpriseSearch::VERSION
|
29
30
|
|
30
31
|
# Module included in Elastic::Enterprise::Client for http requests.
|
@@ -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
|
|