elastic-enterprise-search 7.16.0 → 7.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/test-matrix.yml +2 -2
  3. data/.github/workflows/compatibility.yml +2 -2
  4. data/.github/workflows/testing.yml +1 -1
  5. data/docs/guide/app-search-api.asciidoc +0 -26
  6. data/docs/guide/release_notes/717.asciidoc +9 -0
  7. data/docs/guide/release_notes/index.asciidoc +2 -0
  8. data/lib/elastic/app-search/api/crawler_domain_validation_result.rb +1 -1
  9. data/lib/elastic/app-search/api/crawler_url_tracing_result.rb +2 -1
  10. data/lib/elastic/app-search/api/crawler_url_validation_result.rb +2 -1
  11. data/lib/elastic/app-search/api/create_crawler_crawl_rule.rb +0 -1
  12. data/lib/elastic/app-search/api/create_crawler_entry_point.rb +0 -1
  13. data/lib/elastic/app-search/api/create_crawler_sitemap.rb +0 -1
  14. data/lib/elastic/app-search/api/create_curation.rb +0 -1
  15. data/lib/elastic/app-search/api/log_clickthrough.rb +5 -5
  16. data/lib/elastic/app-search/api/put_crawler_crawl_rule.rb +0 -1
  17. data/lib/elastic/app-search/api/put_crawler_entry_point.rb +0 -1
  18. data/lib/elastic/app-search/api/put_crawler_sitemap.rb +0 -1
  19. data/lib/elastic/app-search/api/put_curation.rb +0 -1
  20. data/lib/elastic/enterprise-search/version.rb +1 -1
  21. data/spec/integration/app-search/crawler_domain_spec.rb +1 -6
  22. metadata +4 -10
  23. data/lib/elastic/app-search/api/adaptive_relevance_settings.rb +0 -51
  24. data/lib/elastic/app-search/api/adaptive_relevance_suggestions.rb +0 -56
  25. data/lib/elastic/app-search/api/list_adaptive_relevance_suggestions.rb +0 -53
  26. data/lib/elastic/app-search/api/list_crawler_domains.rb +0 -51
  27. data/lib/elastic/app-search/api/put_adaptive_relevance_settings.rb +0 -52
  28. data/lib/elastic/app-search/api/put_adaptive_relevance_suggestions.rb +0 -51
  29. data/spec/integration/app-search/adaptive_relevance_spec.rb +0 -80
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3331736a101d1b938e0911742b67fe42a42849e179e8f5b575f9f2b07dafda2
4
- data.tar.gz: 3ef839006353cd13259ec36ddf0244c2c6812f19add3a04b48dd169e2d66238c
3
+ metadata.gz: b57d38a9d4bae9ccd2217e1bd94a06b886a394aafef47a15ba645694404f3183
4
+ data.tar.gz: 3f122a3a3400a56afa448de6d3047df37e897867a2a23be1f24026d76fb31e00
5
5
  SHA512:
6
- metadata.gz: 5f1d529bdbd13f0c550bee3f475ee799ec537e39ffc172b18119a194fe61c27a8452c56e1cd1ee8cb68a6d60fb56da92bc4cadad82d35650119df7ef21647e09
7
- data.tar.gz: 36465dbde68f27f1d39a7afb829e890e6ccda5c6b4fce70186ecc229ada201de89a13fbbd198d2c6a5b483ac4e4e5c28abd516633d5a45c7b241bc2ecc92d6ff
6
+ metadata.gz: 941c3d7645c1126a267662abaf62993581224ef333ad1c6552b52dbeb24508837362afc6f0c6d030e3043567eaebe2b5caa2972571d2610461f15d7f1cf1c88e
7
+ data.tar.gz: e85bab13059c21cdade084f4eb6e676be6d091db4b5d8e44326bfa8256b19e76af630ee41d28ecc5ec0a0c52febec826d8fc628d1205d598703b5a2167102363
data/.ci/test-matrix.yml CHANGED
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  RUBY_VERSION:
3
+ - 3.1
3
4
  - 3.0
4
5
  - 2.7
5
6
  - 2.6
6
- - 2.5
7
7
 
8
8
  STACK_VERSION:
9
- - 7.16-SNAPSHOT
9
+ - 7.17-SNAPSHOT
10
10
 
11
11
  SERVICE:
12
12
  - appsearch
@@ -7,13 +7,13 @@ jobs:
7
7
  ES_VERSION: ${{ matrix.es_version }}
8
8
  strategy:
9
9
  matrix:
10
- es_version: [ 7.11, 7.12, 7.13, 7.14, 7.15 ]
10
+ es_version: [ 7.11, 7.12, 7.13, 7.14, 7.15, 7.16 ]
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: actions/checkout@v2
14
14
  - uses: ruby/setup-ruby@v1
15
15
  with:
16
- ruby-version: 3.0
16
+ ruby-version: 3.1
17
17
  - name: Build Gemfile with Elasticsearch gem
18
18
  run: |
19
19
  ruby -v
@@ -7,7 +7,7 @@ jobs:
7
7
  ENDPOINT: http://localhost:8080
8
8
  strategy:
9
9
  matrix:
10
- ruby: [ 2.5, 2.6, 2.7, 3.0 ]
10
+ ruby: [ '2.6', '2.7', '3.0', '3.1' ]
11
11
 
12
12
  runs-on: ubuntu-latest
13
13
  steps:
@@ -196,9 +196,6 @@ 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
-
202
199
  # Update a crawler domain
203
200
  body = { name: 'https://www.wikipedia.org' }
204
201
  client.put_crawler_domain(engine_name, domain_id: domain_id, domain: body)
@@ -304,29 +301,6 @@ client.crawler_process_crawl_denied_urls(engine_name, process_crawl_id: id)
304
301
  # Cancel an active crawl request, stopping a running crawl if needed.
305
302
  client.delete_crawler_active_crawl_request(engine_name)
306
303
  ----------------------------
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
- ----------------------------
330
304
 
331
305
  === Other API Endpoints
332
306
 
@@ -0,0 +1,9 @@
1
+ [[release_notes_717]]
2
+ === 7.17 Release notes
3
+
4
+ [discrete]
5
+ ==== General
6
+
7
+ - Tested with Elastic Enterprise Search API version 7.17.0.
8
+ - Last release in the `7.x` branch.
9
+ - Tested with Ruby 2.6, 2.7, 3.0, 3.1
@@ -5,6 +5,7 @@
5
5
  [discrete]
6
6
  === 7.x
7
7
 
8
+ * <<release_notes_717, 7.17.0 Release Notes>>
8
9
  * <<release_notes_716, 7.16.0 Release Notes>>
9
10
  * <<release_notes_715, 7.15.0 Release Notes>>
10
11
  * <<release_notes_714, 7.14.0 Release Notes>>
@@ -13,6 +14,7 @@
13
14
  * <<release_notes_711, 7.11.0 Release Notes>>
14
15
  * <<release_notes_710, 7.10.0.beta.1 Release Notes>>
15
16
 
17
+ include::717.asciidoc[]
16
18
  include::716.asciidoc[]
17
19
  include::715.asciidoc[]
18
20
  include::714.asciidoc[]
@@ -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#web-crawler-apis-post-crawler-validate-domain
31
+ # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html
32
32
  #
33
33
  def crawler_domain_validation_result(arguments = {})
34
34
  body = arguments.delete(:body) || {}
@@ -27,9 +27,10 @@ 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*)
30
31
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
31
32
  #
32
- # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-post-crawler-trace-url
33
+ # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html
33
34
  #
34
35
  def crawler_url_tracing_result(engine_name, arguments = {})
35
36
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
@@ -27,9 +27,10 @@ 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*)
30
31
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
31
32
  #
32
- # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-post-crawler-validate-url
33
+ # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html
33
34
  #
34
35
  def crawler_url_validation_result(engine_name, arguments = {})
35
36
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
@@ -33,7 +33,6 @@ 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
37
36
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
38
37
  #
39
38
  # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-post-crawl-rules
@@ -30,7 +30,6 @@ 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
34
33
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
35
34
  #
36
35
  # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-post-entry-points
@@ -30,7 +30,6 @@ 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
34
33
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
35
34
  #
36
35
  # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-post-sitemaps
@@ -31,7 +31,6 @@ 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
35
34
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
36
35
  #
37
36
  # @see https://www.elastic.co/guide/en/app-search/current/curations.html#curations-create
@@ -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 [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
29
+ # @option arguments :body Search request parameters
30
+ # @option body [String] :query Search query text (*Required*)
31
+ # @option body [String] :document_id The id of the document that was clicked on (*Required*)
32
+ # @option body [String] :request_id The request id returned in the meta tag of a search API response
33
+ # @option body [Array] :tags Array of strings representing additional information you wish to track with the clickthrough. You may submit up to 16 tags, and each may be up to 64 characters in length.
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
@@ -34,7 +34,6 @@ 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
38
37
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
39
38
  #
40
39
  # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-put-crawl-rule
@@ -31,7 +31,6 @@ 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
35
34
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
36
35
  #
37
36
  # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-put-entry-point
@@ -31,7 +31,6 @@ 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
35
34
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
36
35
  #
37
36
  # @see https://www.elastic.co/guide/en/app-search/current/web-crawler-api-reference.html#web-crawler-apis-put-sitemap
@@ -32,7 +32,6 @@ 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
36
35
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
37
36
  #
38
37
  # @see https://www.elastic.co/guide/en/app-search/current/curations.html#curations-update
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
- VERSION = '7.16.0'
22
+ VERSION = '7.17.0'
23
23
  end
24
24
  end
@@ -34,7 +34,7 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
34
34
  sleep 1
35
35
  end
36
36
 
37
- it 'creates, gets and lists a crawler domain' do
37
+ it 'creates and gets 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,11 +48,6 @@ 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'])
56
51
  end
57
52
 
58
53
  it 'creates and updates a crawler domain' do
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.16.0
4
+ version: 7.17.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-12-23 00:00:00.000000000 Z
11
+ date: 2022-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: elasticsearch-transport
@@ -202,14 +202,13 @@ files:
202
202
  - docs/guide/release_notes/714.asciidoc
203
203
  - docs/guide/release_notes/715.asciidoc
204
204
  - docs/guide/release_notes/716.asciidoc
205
+ - docs/guide/release_notes/717.asciidoc
205
206
  - docs/guide/release_notes/index.asciidoc
206
207
  - docs/guide/workplace-search-api.asciidoc
207
208
  - elastic-enterprise-search.gemspec
208
209
  - lib/data/ca-bundle.crt
209
210
  - lib/elastic-enterprise-search.rb
210
211
  - lib/elastic/.rubocop.yml
211
- - lib/elastic/app-search/api/adaptive_relevance_settings.rb
212
- - lib/elastic/app-search/api/adaptive_relevance_suggestions.rb
213
212
  - lib/elastic/app-search/api/add_meta_engine_source.rb
214
213
  - lib/elastic/app-search/api/api_key.rb
215
214
  - lib/elastic/app-search/api/api_logs.rb
@@ -255,10 +254,8 @@ files:
255
254
  - lib/elastic/app-search/api/documents.rb
256
255
  - lib/elastic/app-search/api/engine.rb
257
256
  - lib/elastic/app-search/api/index_documents.rb
258
- - lib/elastic/app-search/api/list_adaptive_relevance_suggestions.rb
259
257
  - lib/elastic/app-search/api/list_api_keys.rb
260
258
  - lib/elastic/app-search/api/list_crawler_crawl_requests.rb
261
- - lib/elastic/app-search/api/list_crawler_domains.rb
262
259
  - lib/elastic/app-search/api/list_crawler_process_crawls.rb
263
260
  - lib/elastic/app-search/api/list_curations.rb
264
261
  - lib/elastic/app-search/api/list_documents.rb
@@ -266,8 +263,6 @@ files:
266
263
  - lib/elastic/app-search/api/list_synonym_sets.rb
267
264
  - lib/elastic/app-search/api/log_clickthrough.rb
268
265
  - 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
271
266
  - lib/elastic/app-search/api/put_api_key.rb
272
267
  - lib/elastic/app-search/api/put_crawler_crawl_rule.rb
273
268
  - lib/elastic/app-search/api/put_crawler_crawl_schedule.rb
@@ -344,7 +339,6 @@ files:
344
339
  - spec/fixtures/vcr/workplace_search/create_analytics_event.yml
345
340
  - spec/fixtures/vcr/workplace_search/oauth_request_token.yml
346
341
  - spec/fixtures/vcr/workplace_search/search_request.yml
347
- - spec/integration/app-search/adaptive_relevance_spec.rb
348
342
  - spec/integration/app-search/api_key_spec.rb
349
343
  - spec/integration/app-search/api_logs_spec.rb
350
344
  - spec/integration/app-search/app_search_helper.rb
@@ -412,7 +406,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
412
406
  - !ruby/object:Gem::Version
413
407
  version: '0'
414
408
  requirements: []
415
- rubygems_version: 3.2.22
409
+ rubygems_version: 3.3.3
416
410
  signing_key:
417
411
  specification_version: 4
418
412
  summary: Official API client for Elastic Enterprise Search
@@ -1,51 +0,0 @@
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
@@ -1,56 +0,0 @@
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
@@ -1,53 +0,0 @@
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
@@ -1,51 +0,0 @@
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
@@ -1,52 +0,0 @@
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
@@ -1,51 +0,0 @@
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
@@ -1,80 +0,0 @@
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