elastic-enterprise-search 7.15.1 → 7.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ci/test-matrix.yml +1 -1
- data/.github/workflows/testing.yml +1 -1
- data/docs/guide/app-search-api.asciidoc +26 -0
- data/docs/guide/release_notes/716.asciidoc +16 -0
- data/docs/guide/release_notes/index.asciidoc +2 -0
- data/docs/guide/workplace-search-api.asciidoc +3 -0
- data/lib/elastic/app-search/api/adaptive_relevance_settings.rb +51 -0
- data/lib/elastic/app-search/api/adaptive_relevance_suggestions.rb +56 -0
- data/lib/elastic/app-search/api/crawler_domain_validation_result.rb +1 -1
- data/lib/elastic/app-search/api/crawler_url_tracing_result.rb +1 -2
- data/lib/elastic/app-search/api/crawler_url_validation_result.rb +1 -2
- data/lib/elastic/app-search/api/create_crawler_crawl_rule.rb +1 -0
- data/lib/elastic/app-search/api/create_crawler_entry_point.rb +1 -0
- data/lib/elastic/app-search/api/create_crawler_sitemap.rb +1 -0
- data/lib/elastic/app-search/api/create_curation.rb +1 -0
- data/lib/elastic/app-search/api/list_adaptive_relevance_suggestions.rb +53 -0
- data/lib/elastic/app-search/api/list_crawler_domains.rb +51 -0
- data/lib/elastic/app-search/api/log_clickthrough.rb +5 -5
- data/lib/elastic/app-search/api/put_adaptive_relevance_settings.rb +52 -0
- data/lib/elastic/app-search/api/put_adaptive_relevance_suggestions.rb +51 -0
- data/lib/elastic/app-search/api/put_crawler_crawl_rule.rb +1 -0
- data/lib/elastic/app-search/api/put_crawler_entry_point.rb +1 -0
- data/lib/elastic/app-search/api/put_crawler_sitemap.rb +1 -0
- data/lib/elastic/app-search/api/put_curation.rb +1 -0
- data/lib/elastic/enterprise-search/version.rb +1 -1
- data/lib/elastic/workplace-search/api/list_documents.rb +55 -0
- data/spec/integration/app-search/adaptive_relevance_spec.rb +80 -0
- data/spec/integration/app-search/api_logs_spec.rb +1 -1
- data/spec/integration/app-search/crawler_domain_spec.rb +6 -1
- data/spec/integration/workplace-search/documents_spec.rb +7 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3331736a101d1b938e0911742b67fe42a42849e179e8f5b575f9f2b07dafda2
|
4
|
+
data.tar.gz: 3ef839006353cd13259ec36ddf0244c2c6812f19add3a04b48dd169e2d66238c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f1d529bdbd13f0c550bee3f475ee799ec537e39ffc172b18119a194fe61c27a8452c56e1cd1ee8cb68a6d60fb56da92bc4cadad82d35650119df7ef21647e09
|
7
|
+
data.tar.gz: 36465dbde68f27f1d39a7afb829e890e6ccda5c6b4fce70186ecc229ada201de89a13fbbd198d2c6a5b483ac4e4e5c28abd516633d5a45c7b241bc2ecc92d6ff
|
data/.ci/test-matrix.yml
CHANGED
@@ -196,6 +196,9 @@ client.create_crawler_domain(engine_name, body: body)
|
|
196
196
|
# Get crawler domain information
|
197
197
|
client.crawler_domain(engine_name, domain_id: domain_id)
|
198
198
|
|
199
|
+
# List crawler domains
|
200
|
+
client.list_crawler_domains(engine_name)
|
201
|
+
|
199
202
|
# Update a crawler domain
|
200
203
|
body = { name: 'https://www.wikipedia.org' }
|
201
204
|
client.put_crawler_domain(engine_name, domain_id: domain_id, domain: body)
|
@@ -301,6 +304,29 @@ client.crawler_process_crawl_denied_urls(engine_name, process_crawl_id: id)
|
|
301
304
|
# Cancel an active crawl request, stopping a running crawl if needed.
|
302
305
|
client.delete_crawler_active_crawl_request(engine_name)
|
303
306
|
----------------------------
|
307
|
+
=== Adaptive Relevance
|
308
|
+
|
309
|
+
|
310
|
+
The adaptive relevance API is a **beta** feature. Beta features are subject to change and are not covered by the support SLA of general release (GA) features. Elastic plans to promote this feature to GA in a future release. The adaptive relevance API is not available at all Elastic subscription levels. Refer to the Elastic subscriptions pages for https://www.elastic.co/subscriptions/cloud[Elastic Cloud] and https://www.elastic.co/subscriptions[self-managed] deployments.
|
311
|
+
|
312
|
+
[source,rb]
|
313
|
+
----------------------------
|
314
|
+
# Retrieve adaptive relevance settings
|
315
|
+
client.adaptive_relevance_settings(engine_name)
|
316
|
+
|
317
|
+
# Update adaptive relevance settings for an engine
|
318
|
+
body = { curation: { enabled: true } }
|
319
|
+
client.put_adaptive_relevance_settings(engine_name, body: body)
|
320
|
+
|
321
|
+
# List suggestions
|
322
|
+
client.list_adaptive_relevance_suggestions(engine_name)
|
323
|
+
|
324
|
+
# Update adaptive relevance
|
325
|
+
client.put_adaptive_relevance_suggestions(engine_name, body: body)
|
326
|
+
|
327
|
+
# Retrive adaptive relevance
|
328
|
+
client.adaptive_relevance_suggestions(engine_name, search_suggestion_query: 'suggestion')
|
329
|
+
----------------------------
|
304
330
|
|
305
331
|
=== Other API Endpoints
|
306
332
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
[[release_notes_716]]
|
2
|
+
=== 7.16 Release notes
|
3
|
+
|
4
|
+
[discrete]
|
5
|
+
==== General
|
6
|
+
|
7
|
+
- Tested with Elastic Enterprise Search API version 7.16.0.
|
8
|
+
|
9
|
+
[discrete]
|
10
|
+
==== App Search
|
11
|
+
|
12
|
+
- Adds Adaptive Relevance APIs. The adaptive relevance API is a **beta** feature. Beta features are subject to change and are not covered by the support SLA of general release (GA) features. Elastic plans to promote this feature to GA in a future release. The adaptive relevance API is not available at all Elastic subscription levels. Refer to the Elastic subscriptions pages for https://www.elastic.co/subscriptions/cloud[Elastic Cloud] and https://www.elastic.co/subscriptions[self-managed] deployments: `adaptive_relevance_settings`, `adaptive_relevance_suggestions`, `list adaptive_relevance_suggestions`, `put_adaptive_relevance_settings`, `put_adaptive_relevance_suggestions`.
|
13
|
+
- Adds `list_crawler_domains` - Returns a list of crawler domains
|
14
|
+
|
15
|
+
==== Workplace Search
|
16
|
+
- Adds `list_documents` - List documents from a custom content source
|
@@ -5,6 +5,7 @@
|
|
5
5
|
[discrete]
|
6
6
|
=== 7.x
|
7
7
|
|
8
|
+
* <<release_notes_716, 7.16.0 Release Notes>>
|
8
9
|
* <<release_notes_715, 7.15.0 Release Notes>>
|
9
10
|
* <<release_notes_714, 7.14.0 Release Notes>>
|
10
11
|
* <<release_notes_713, 7.13.0 Release Notes>>
|
@@ -12,6 +13,7 @@
|
|
12
13
|
* <<release_notes_711, 7.11.0 Release Notes>>
|
13
14
|
* <<release_notes_710, 7.10.0.beta.1 Release Notes>>
|
14
15
|
|
16
|
+
include::716.asciidoc[]
|
15
17
|
include::715.asciidoc[]
|
16
18
|
include::714.asciidoc[]
|
17
19
|
include::713.asciidoc[]
|
@@ -59,6 +59,9 @@ response = client.index_documents(content_source_id, body: documents)
|
|
59
59
|
# Retrieve a document by ID from a specified content source
|
60
60
|
client.document(content_source_id, document_id: '75015d85370d')
|
61
61
|
|
62
|
+
# List documents from a custom content source
|
63
|
+
client.list_documents(content_source_id)
|
64
|
+
|
62
65
|
# Delete Documents
|
63
66
|
client.delete_documents(content_source_id, document_ids: ['e68fbc2688f1', 'c535e226aee3'])
|
64
67
|
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module AppSearch
|
23
|
+
module Actions
|
24
|
+
# AdaptiveRelevanceSettings - Retrieve adaptive relevance settings
|
25
|
+
# Retrieve adaptive relevance settings
|
26
|
+
#
|
27
|
+
# @param engine_name [String] Name of the engine (*Required*)
|
28
|
+
# @param arguments [Hash] endpoint arguments
|
29
|
+
# @option arguments [Hash] :body The request body
|
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-get-engine-adaptive-relevance-settings
|
33
|
+
#
|
34
|
+
def adaptive_relevance_settings(engine_name, arguments = {})
|
35
|
+
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
36
|
+
|
37
|
+
body = arguments.delete(:body) || {}
|
38
|
+
headers = arguments.delete(:headers) || {}
|
39
|
+
|
40
|
+
request(
|
41
|
+
:get,
|
42
|
+
"api/as/v0/engines/#{engine_name}/adaptive_relevance/settings/",
|
43
|
+
arguments,
|
44
|
+
body,
|
45
|
+
headers
|
46
|
+
)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -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
|
+
# AdaptiveRelevanceSuggestions - Retrieve adaptive relevance
|
25
|
+
# Retrieve adaptive relevance for a single query
|
26
|
+
#
|
27
|
+
# @param engine_name [String] Name of the engine (*Required*)
|
28
|
+
# @param arguments [Hash] endpoint arguments
|
29
|
+
# @option arguments [String] :search_suggestion_query Query to obtain suggestions (*Required*)
|
30
|
+
# @option arguments [Hash] :body
|
31
|
+
# @option body :page
|
32
|
+
# @option body :filters
|
33
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
34
|
+
#
|
35
|
+
# @see https://www.elastic.co/guide/en/app-search/current/adaptive-relevance-api-reference.html#adaptive-relevance-api-get-engine-adaptive-relevance-suggestions-query
|
36
|
+
#
|
37
|
+
def adaptive_relevance_suggestions(engine_name, arguments = {})
|
38
|
+
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
39
|
+
raise ArgumentError, "Required parameter 'search_suggestion_query' missing" unless arguments[:search_suggestion_query]
|
40
|
+
|
41
|
+
search_suggestion_query = arguments[:search_suggestion_query]
|
42
|
+
body = arguments.delete(:body) || {}
|
43
|
+
headers = arguments.delete(:headers) || {}
|
44
|
+
|
45
|
+
request(
|
46
|
+
:post,
|
47
|
+
"api/as/v0/engines/#{engine_name}/adaptive_relevance/suggestions/#{search_suggestion_query}/",
|
48
|
+
arguments,
|
49
|
+
body,
|
50
|
+
headers
|
51
|
+
)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -28,7 +28,7 @@ module Elastic
|
|
28
28
|
# @option arguments [String] :body
|
29
29
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
30
|
#
|
31
|
-
# @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html
|
31
|
+
# @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-post-crawler-validate-domain
|
32
32
|
#
|
33
33
|
def crawler_domain_validation_result(arguments = {})
|
34
34
|
body = arguments.delete(:body) || {}
|
@@ -27,10 +27,9 @@ module Elastic
|
|
27
27
|
# @param engine_name [String] Name of the engine (*Required*)
|
28
28
|
# @param arguments [Hash] endpoint arguments
|
29
29
|
# @option arguments [String] :body
|
30
|
-
# @option arguments [String] :url (*Required*)
|
31
30
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
32
31
|
#
|
33
|
-
# @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html
|
32
|
+
# @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-post-crawler-trace-url
|
34
33
|
#
|
35
34
|
def crawler_url_tracing_result(engine_name, arguments = {})
|
36
35
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
@@ -27,10 +27,9 @@ module Elastic
|
|
27
27
|
# @param engine_name [String] Name of the engine (*Required*)
|
28
28
|
# @param arguments [Hash] endpoint arguments
|
29
29
|
# @option arguments [String] :body
|
30
|
-
# @option arguments [String] :url (*Required*)
|
31
30
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
32
31
|
#
|
33
|
-
# @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html
|
32
|
+
# @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-post-crawler-validate-url
|
34
33
|
#
|
35
34
|
def crawler_url_validation_result(engine_name, arguments = {})
|
36
35
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
@@ -33,6 +33,7 @@ module Elastic
|
|
33
33
|
# @option body [String] :policy (*Required)
|
34
34
|
# @option body [String] :rule (*Required)
|
35
35
|
# @option body [String] :pattern (*Required)
|
36
|
+
# @option body [String] :created_at
|
36
37
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
37
38
|
#
|
38
39
|
# @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-post-crawl-rules
|
@@ -30,6 +30,7 @@ module Elastic
|
|
30
30
|
# @option arguments [Hash] :body (Required: value)
|
31
31
|
# @option body [String] :id
|
32
32
|
# @option body [String] :value (*Required)
|
33
|
+
# @option body [String] :created_at
|
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/web-crawler-api-reference.html#web-crawler-apis-post-entry-points
|
@@ -30,6 +30,7 @@ module Elastic
|
|
30
30
|
# @option arguments [Hash] :body (Required: url)
|
31
31
|
# @option body [String] :id
|
32
32
|
# @option body [String] :url (*Required)
|
33
|
+
# @option body [String] :created_at
|
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/web-crawler-api-reference.html#web-crawler-apis-post-sitemaps
|
@@ -31,6 +31,7 @@ module Elastic
|
|
31
31
|
# @option body [Array] :queries List of affected search queries (*Required)
|
32
32
|
# @option body [Array] :promoted List of promoted document IDs
|
33
33
|
# @option body [Array] :hidden List of hidden document IDs
|
34
|
+
# @option body :suggestion
|
34
35
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
35
36
|
#
|
36
37
|
# @see https://www.elastic.co/guide/en/app-search/current/curations.html#curations-create
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module AppSearch
|
23
|
+
module Actions
|
24
|
+
# AdaptiveRelevanceSuggestions - Retrieve adaptive relevance
|
25
|
+
# Retrieve adaptive relevance
|
26
|
+
#
|
27
|
+
# @param engine_name [String] Name of the engine (*Required*)
|
28
|
+
# @param arguments [Hash] endpoint arguments
|
29
|
+
# @option arguments [Hash] :body
|
30
|
+
# @option body :page
|
31
|
+
# @option body :filters
|
32
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
33
|
+
#
|
34
|
+
# @see https://www.elastic.co/guide/en/app-search/current/adaptive-relevance-api-reference.html#adaptive-relevance-api-get-engine-adaptive-relevance-suggestions
|
35
|
+
#
|
36
|
+
def list_adaptive_relevance_suggestions(engine_name, arguments = {})
|
37
|
+
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
38
|
+
|
39
|
+
body = arguments.delete(:body) || {}
|
40
|
+
headers = arguments.delete(:headers) || {}
|
41
|
+
|
42
|
+
request(
|
43
|
+
:post,
|
44
|
+
"api/as/v0/engines/#{engine_name}/adaptive_relevance/suggestions/",
|
45
|
+
arguments,
|
46
|
+
body,
|
47
|
+
headers
|
48
|
+
)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module AppSearch
|
23
|
+
module Actions
|
24
|
+
# Crawler - List crawler domains
|
25
|
+
# Returns a list of crawler domains
|
26
|
+
#
|
27
|
+
# @param engine_name [String] Name of the engine (*Required*)
|
28
|
+
# @param arguments [Hash] endpoint arguments
|
29
|
+
# @option arguments [Hash] :body The request body
|
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/web-crawler-api-reference.html#web-crawler-apis-get-crawler-domain
|
33
|
+
#
|
34
|
+
def list_crawler_domains(engine_name, arguments = {})
|
35
|
+
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
36
|
+
|
37
|
+
body = arguments.delete(:body) || {}
|
38
|
+
headers = arguments.delete(:headers) || {}
|
39
|
+
|
40
|
+
request(
|
41
|
+
:get,
|
42
|
+
"api/as/v0/engines/#{engine_name}/crawler/domains/",
|
43
|
+
arguments,
|
44
|
+
body,
|
45
|
+
headers
|
46
|
+
)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -26,11 +26,11 @@ module Elastic
|
|
26
26
|
#
|
27
27
|
# @param engine_name [String] Name of the engine (*Required*)
|
28
28
|
# @param arguments [Hash] endpoint arguments
|
29
|
-
# @option arguments :body
|
30
|
-
# @option body [String] :query
|
31
|
-
# @option body [String] :
|
32
|
-
# @option body
|
33
|
-
# @option body [Array] :tags
|
29
|
+
# @option arguments [Hash] :body (Required: query, document_id)
|
30
|
+
# @option body [String] :query (*Required)
|
31
|
+
# @option body [String] :request_id
|
32
|
+
# @option body :document_id (*Required)
|
33
|
+
# @option body [Array] :tags
|
34
34
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
35
35
|
#
|
36
36
|
# @see https://www.elastic.co/guide/en/app-search/current/clickthrough.html
|
@@ -0,0 +1,52 @@
|
|
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 - Update adaptive relevance settings
|
25
|
+
# Update adaptive relevance settings
|
26
|
+
#
|
27
|
+
# @param engine_name [String] Name of the engine (*Required*)
|
28
|
+
# @param arguments [Hash] endpoint arguments
|
29
|
+
# @option arguments [Hash] :body (Required: curation)
|
30
|
+
# @option body [Object] :curation (*Required)
|
31
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
32
|
+
#
|
33
|
+
# @see https://www.elastic.co/guide/en/app-search/current/adaptive-relevance-api-reference.html#adaptive-relevance-api-put-engine-adaptive-relevance-settings
|
34
|
+
#
|
35
|
+
def put_adaptive_relevance_settings(engine_name, arguments = {})
|
36
|
+
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
37
|
+
|
38
|
+
body = arguments.delete(:body) || {}
|
39
|
+
headers = arguments.delete(:headers) || {}
|
40
|
+
|
41
|
+
request(
|
42
|
+
:put,
|
43
|
+
"api/as/v0/engines/#{engine_name}/adaptive_relevance/settings/",
|
44
|
+
arguments,
|
45
|
+
body,
|
46
|
+
headers
|
47
|
+
)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module AppSearch
|
23
|
+
module Actions
|
24
|
+
# AdaptiveRelevanceSuggestions - Update adaptive relevance
|
25
|
+
# Update adaptive relevance
|
26
|
+
#
|
27
|
+
# @param engine_name [String] Name of the engine (*Required*)
|
28
|
+
# @param arguments [Hash] endpoint arguments
|
29
|
+
# @option arguments [Array] :body
|
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-put-engine-adaptive-relevance-suggestions
|
33
|
+
#
|
34
|
+
def put_adaptive_relevance_suggestions(engine_name, arguments = {})
|
35
|
+
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
36
|
+
|
37
|
+
body = arguments.delete(:body) || {}
|
38
|
+
headers = arguments.delete(:headers) || {}
|
39
|
+
|
40
|
+
request(
|
41
|
+
:put,
|
42
|
+
"api/as/v0/engines/#{engine_name}/adaptive_relevance/suggestions/",
|
43
|
+
arguments,
|
44
|
+
body,
|
45
|
+
headers
|
46
|
+
)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -34,6 +34,7 @@ module Elastic
|
|
34
34
|
# @option body [String] :policy (*Required)
|
35
35
|
# @option body [String] :rule (*Required)
|
36
36
|
# @option body [String] :pattern (*Required)
|
37
|
+
# @option body [String] :created_at
|
37
38
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
38
39
|
#
|
39
40
|
# @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-put-crawl-rule
|
@@ -31,6 +31,7 @@ module Elastic
|
|
31
31
|
# @option arguments [Hash] :body (Required: value)
|
32
32
|
# @option body [String] :id
|
33
33
|
# @option body [String] :value (*Required)
|
34
|
+
# @option body [String] :created_at
|
34
35
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
35
36
|
#
|
36
37
|
# @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-put-entry-point
|
@@ -31,6 +31,7 @@ module Elastic
|
|
31
31
|
# @option arguments [Hash] :body (Required: url)
|
32
32
|
# @option body [String] :id
|
33
33
|
# @option body [String] :url (*Required)
|
34
|
+
# @option body [String] :created_at
|
34
35
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
35
36
|
#
|
36
37
|
# @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-put-sitemap
|
@@ -32,6 +32,7 @@ module Elastic
|
|
32
32
|
# @option body [Array] :queries List of affected search queries (*Required)
|
33
33
|
# @option body [Array] :promoted List of promoted document IDs
|
34
34
|
# @option body [Array] :hidden List of hidden document IDs
|
35
|
+
# @option body :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
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module EnterpriseSearch
|
22
|
+
module WorkplaceSearch
|
23
|
+
module Actions
|
24
|
+
# Documents - Lists documents from a custom content source
|
25
|
+
# Lists documents from a custom content source
|
26
|
+
#
|
27
|
+
# @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
|
28
|
+
# @param arguments [Hash] endpoint arguments
|
29
|
+
# @option arguments [Hash] :body
|
30
|
+
# @option body [Object] :page Paging controls for the result set
|
31
|
+
# @option body :filters
|
32
|
+
# @option body :sort
|
33
|
+
# @option body [String] :cursor
|
34
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
35
|
+
#
|
36
|
+
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-custom-sources-api.html#list-documents
|
37
|
+
#
|
38
|
+
def list_documents(content_source_id, arguments = {})
|
39
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
40
|
+
|
41
|
+
body = arguments.delete(:body) || {}
|
42
|
+
headers = arguments.delete(:headers) || {}
|
43
|
+
|
44
|
+
request(
|
45
|
+
:post,
|
46
|
+
"api/ws/v1/sources/#{content_source_id}/documents/",
|
47
|
+
arguments,
|
48
|
+
body,
|
49
|
+
headers
|
50
|
+
)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,80 @@
|
|
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' do
|
24
|
+
let(:engine_name) { 'adaptive-relevance' }
|
25
|
+
|
26
|
+
before do
|
27
|
+
create_engine(engine_name)
|
28
|
+
end
|
29
|
+
|
30
|
+
after do
|
31
|
+
delete_engines
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'retrieves adaptive relevance settings' do
|
35
|
+
response = client.adaptive_relevance_settings(engine_name)
|
36
|
+
expect(response.body['curation'])
|
37
|
+
expect(response.status).to eq 200
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'updates settings and lists adaptive relevance for an engine' do
|
41
|
+
body = { curation: { enabled: true } }
|
42
|
+
# Enables curations
|
43
|
+
response = client.put_adaptive_relevance_settings(engine_name, body: body)
|
44
|
+
expect(response.status).to eq 200
|
45
|
+
expect(response.body.dig('curation', 'enabled'))
|
46
|
+
|
47
|
+
# Lists suggestions
|
48
|
+
response = client.list_adaptive_relevance_suggestions(engine_name)
|
49
|
+
expect(response.status).to eq 200
|
50
|
+
expect(response.body['meta'])
|
51
|
+
expect(response.body['results'])
|
52
|
+
end
|
53
|
+
|
54
|
+
xit 'updates adaptive relevance' do
|
55
|
+
body = { curation: { enabled: true } }
|
56
|
+
client.put_adaptive_relevance_settings(engine_name, body: body)
|
57
|
+
|
58
|
+
# Index document and create curation:
|
59
|
+
id = client.index_documents(engine_name, documents: [{ title: 'experiment' }]).body.first['id']
|
60
|
+
body = { queries: ['test'], promoted: [id] }
|
61
|
+
client.create_curation(engine_name, body: body)
|
62
|
+
body = [{ query: 'test', type: 'curation', status: 'applied' }]
|
63
|
+
response = client.put_adaptive_relevance_suggestions(engine_name, body: body)
|
64
|
+
|
65
|
+
expect(response.status).to eq 200
|
66
|
+
end
|
67
|
+
|
68
|
+
xit 'retrieves an adaptive relevance' do
|
69
|
+
# Enables curations
|
70
|
+
client.put_adaptive_relevance_settings(engine_name, body: { curation: { enabled: true } })
|
71
|
+
id = client.index_documents(engine_name, documents: [{ title: 'experiment' }]).body.first['id']
|
72
|
+
body = { queries: ['test'], promoted: [id] }
|
73
|
+
client.create_curation(engine_name, body: body)
|
74
|
+
|
75
|
+
response = client.adaptive_relevance_suggestions(engine_name, search_suggestion_query: 'test')
|
76
|
+
expect(response.status).to eq 200
|
77
|
+
expect(response.body)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -34,7 +34,7 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
34
34
|
sleep 1
|
35
35
|
end
|
36
36
|
|
37
|
-
it 'creates and
|
37
|
+
it 'creates, gets and lists a crawler domain' do
|
38
38
|
body = { name: name }
|
39
39
|
response = client.create_crawler_domain(engine_name, body: body)
|
40
40
|
@domain = response.body
|
@@ -48,6 +48,11 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
48
48
|
expect(response.status).to eq 200
|
49
49
|
expect(response.body['id']).to eq @domain['id']
|
50
50
|
expect(response.body).to include('name' => name)
|
51
|
+
|
52
|
+
# client.list_crawler_domains
|
53
|
+
response = client.list_crawler_domains(engine_name)
|
54
|
+
expect(response.status).to eq 200
|
55
|
+
expect(response.body['results'].first['id']).to eq(@domain['id'])
|
51
56
|
end
|
52
57
|
|
53
58
|
it 'creates and updates a crawler domain' do
|
@@ -67,6 +67,13 @@ describe Elastic::EnterpriseSearch::WorkplaceSearch::Client do
|
|
67
67
|
expect(response.body['id']).to eq document_id
|
68
68
|
end
|
69
69
|
|
70
|
+
it 'Lists documents in a content source' do
|
71
|
+
response = client.list_documents(content_source_id)
|
72
|
+
expect(response.status).to eq 200
|
73
|
+
expect(response.body['results'])
|
74
|
+
expect(response.body['meta'])
|
75
|
+
end
|
76
|
+
|
70
77
|
it 'Deletes all documents in a content source' do
|
71
78
|
response = client.delete_all_documents(content_source_id)
|
72
79
|
expect(response.status).to eq 200
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastic-enterprise-search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fernando Briano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: elasticsearch-transport
|
@@ -201,12 +201,15 @@ files:
|
|
201
201
|
- docs/guide/release_notes/713.asciidoc
|
202
202
|
- docs/guide/release_notes/714.asciidoc
|
203
203
|
- docs/guide/release_notes/715.asciidoc
|
204
|
+
- docs/guide/release_notes/716.asciidoc
|
204
205
|
- docs/guide/release_notes/index.asciidoc
|
205
206
|
- docs/guide/workplace-search-api.asciidoc
|
206
207
|
- elastic-enterprise-search.gemspec
|
207
208
|
- lib/data/ca-bundle.crt
|
208
209
|
- lib/elastic-enterprise-search.rb
|
209
210
|
- lib/elastic/.rubocop.yml
|
211
|
+
- lib/elastic/app-search/api/adaptive_relevance_settings.rb
|
212
|
+
- lib/elastic/app-search/api/adaptive_relevance_suggestions.rb
|
210
213
|
- lib/elastic/app-search/api/add_meta_engine_source.rb
|
211
214
|
- lib/elastic/app-search/api/api_key.rb
|
212
215
|
- lib/elastic/app-search/api/api_logs.rb
|
@@ -252,8 +255,10 @@ files:
|
|
252
255
|
- lib/elastic/app-search/api/documents.rb
|
253
256
|
- lib/elastic/app-search/api/engine.rb
|
254
257
|
- lib/elastic/app-search/api/index_documents.rb
|
258
|
+
- lib/elastic/app-search/api/list_adaptive_relevance_suggestions.rb
|
255
259
|
- lib/elastic/app-search/api/list_api_keys.rb
|
256
260
|
- lib/elastic/app-search/api/list_crawler_crawl_requests.rb
|
261
|
+
- lib/elastic/app-search/api/list_crawler_domains.rb
|
257
262
|
- lib/elastic/app-search/api/list_crawler_process_crawls.rb
|
258
263
|
- lib/elastic/app-search/api/list_curations.rb
|
259
264
|
- lib/elastic/app-search/api/list_documents.rb
|
@@ -261,6 +266,8 @@ files:
|
|
261
266
|
- lib/elastic/app-search/api/list_synonym_sets.rb
|
262
267
|
- lib/elastic/app-search/api/log_clickthrough.rb
|
263
268
|
- lib/elastic/app-search/api/multi_search.rb
|
269
|
+
- lib/elastic/app-search/api/put_adaptive_relevance_settings.rb
|
270
|
+
- lib/elastic/app-search/api/put_adaptive_relevance_suggestions.rb
|
264
271
|
- lib/elastic/app-search/api/put_api_key.rb
|
265
272
|
- lib/elastic/app-search/api/put_crawler_crawl_rule.rb
|
266
273
|
- lib/elastic/app-search/api/put_crawler_crawl_schedule.rb
|
@@ -312,6 +319,7 @@ files:
|
|
312
319
|
- lib/elastic/workplace-search/api/external_identity.rb
|
313
320
|
- lib/elastic/workplace-search/api/index_documents.rb
|
314
321
|
- lib/elastic/workplace-search/api/list_content_sources.rb
|
322
|
+
- lib/elastic/workplace-search/api/list_documents.rb
|
315
323
|
- lib/elastic/workplace-search/api/list_external_identities.rb
|
316
324
|
- lib/elastic/workplace-search/api/list_permissions.rb
|
317
325
|
- lib/elastic/workplace-search/api/list_synonym_sets.rb
|
@@ -336,6 +344,7 @@ files:
|
|
336
344
|
- spec/fixtures/vcr/workplace_search/create_analytics_event.yml
|
337
345
|
- spec/fixtures/vcr/workplace_search/oauth_request_token.yml
|
338
346
|
- spec/fixtures/vcr/workplace_search/search_request.yml
|
347
|
+
- spec/integration/app-search/adaptive_relevance_spec.rb
|
339
348
|
- spec/integration/app-search/api_key_spec.rb
|
340
349
|
- spec/integration/app-search/api_logs_spec.rb
|
341
350
|
- spec/integration/app-search/app_search_helper.rb
|