elastic-enterprise-search 8.0.0.pre → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/jobs/{elastic+enterprise-search-ruby+7.13.yml → elastic+enterprise-search-ruby+7.17.yml} +4 -4
  3. data/.ci/jobs/{elastic+enterprise-search-ruby+7.14.yml → elastic+enterprise-search-ruby+8.0.yml} +4 -4
  4. data/.ci/run-enterprise-search.sh +1 -0
  5. data/.ci/test-matrix.yml +1 -1
  6. data/.github/workflows/testing.yml +1 -2
  7. data/docs/guide/app-search-api.asciidoc +58 -9
  8. data/docs/guide/release_notes/714.asciidoc +12 -0
  9. data/docs/guide/release_notes/715.asciidoc +12 -0
  10. data/docs/guide/release_notes/80.asciidoc +108 -5
  11. data/docs/guide/release_notes/81.asciidoc +8 -0
  12. data/docs/guide/release_notes/82.asciidoc +31 -0
  13. data/docs/guide/release_notes/index.asciidoc +5 -3
  14. data/docs/guide/workplace-search-api.asciidoc +17 -7
  15. data/elastic-enterprise-search.gemspec +1 -1
  16. data/lib/elastic/app-search/api/adaptive_relevance_suggestions.rb +1 -2
  17. data/lib/elastic/app-search/api/add_meta_engine_source.rb +0 -1
  18. data/lib/elastic/app-search/api/api_key.rb +0 -1
  19. data/lib/elastic/app-search/api/api_logs.rb +0 -1
  20. data/lib/elastic/app-search/api/count_analytics.rb +0 -1
  21. data/lib/elastic/app-search/api/crawler_crawl_request.rb +0 -1
  22. data/lib/elastic/app-search/api/crawler_domain.rb +0 -1
  23. data/lib/elastic/app-search/api/crawler_domain_validation_result.rb +0 -1
  24. data/lib/elastic/app-search/api/crawler_process_crawl.rb +0 -1
  25. data/lib/elastic/app-search/api/crawler_process_crawl_denied_urls.rb +0 -1
  26. data/lib/elastic/app-search/api/crawler_url_extraction_result.rb +1 -2
  27. data/lib/elastic/app-search/api/crawler_url_tracing_result.rb +0 -1
  28. data/lib/elastic/app-search/api/crawler_url_validation_result.rb +0 -1
  29. data/lib/elastic/app-search/api/create_api_key.rb +0 -1
  30. data/lib/elastic/app-search/api/create_crawler_crawl_request.rb +1 -1
  31. data/lib/elastic/app-search/api/create_crawler_crawl_rule.rb +0 -1
  32. data/lib/elastic/app-search/api/create_crawler_domain.rb +0 -1
  33. data/lib/elastic/app-search/api/create_crawler_entry_point.rb +0 -1
  34. data/lib/elastic/app-search/api/create_crawler_process_crawl.rb +0 -1
  35. data/lib/elastic/app-search/api/create_crawler_sitemap.rb +0 -1
  36. data/lib/elastic/app-search/api/create_curation.rb +1 -2
  37. data/lib/elastic/app-search/api/create_engine.rb +0 -1
  38. data/lib/elastic/app-search/api/create_synonym_set.rb +0 -1
  39. data/lib/elastic/app-search/api/curation.rb +0 -1
  40. data/lib/elastic/app-search/api/delete_api_key.rb +0 -1
  41. data/lib/elastic/app-search/api/delete_crawler_crawl_rule.rb +0 -1
  42. data/lib/elastic/app-search/api/delete_crawler_domain.rb +0 -1
  43. data/lib/elastic/app-search/api/delete_crawler_entry_point.rb +0 -1
  44. data/lib/elastic/app-search/api/delete_crawler_sitemap.rb +0 -1
  45. data/lib/elastic/app-search/api/delete_curation.rb +0 -1
  46. data/lib/elastic/app-search/api/delete_documents.rb +0 -1
  47. data/lib/elastic/app-search/api/delete_meta_engine_source.rb +0 -1
  48. data/lib/elastic/app-search/api/delete_synonym_set.rb +0 -1
  49. data/lib/elastic/app-search/api/documents.rb +0 -1
  50. data/lib/elastic/app-search/api/index_documents.rb +0 -1
  51. data/lib/elastic/app-search/api/list_adaptive_relevance_suggestions.rb +1 -2
  52. data/lib/elastic/app-search/api/log_clickthrough.rb +0 -1
  53. data/lib/elastic/app-search/api/put_adaptive_relevance_settings.rb +1 -2
  54. data/lib/elastic/app-search/api/put_adaptive_relevance_suggestions.rb +0 -1
  55. data/lib/elastic/app-search/api/put_api_key.rb +0 -1
  56. data/lib/elastic/app-search/api/put_crawler_crawl_rule.rb +0 -1
  57. data/lib/elastic/app-search/api/put_crawler_crawl_schedule.rb +0 -1
  58. data/lib/elastic/app-search/api/put_crawler_domain.rb +0 -1
  59. data/lib/elastic/app-search/api/put_crawler_entry_point.rb +0 -1
  60. data/lib/elastic/app-search/api/put_crawler_sitemap.rb +0 -1
  61. data/lib/elastic/app-search/api/put_curation.rb +1 -2
  62. data/lib/elastic/app-search/api/put_documents.rb +0 -1
  63. data/lib/elastic/app-search/api/put_schema.rb +0 -1
  64. data/lib/elastic/app-search/api/put_search_settings.rb +0 -1
  65. data/lib/elastic/app-search/api/put_synonym_set.rb +0 -1
  66. data/lib/elastic/app-search/api/query_suggestion.rb +0 -1
  67. data/lib/elastic/app-search/api/refresh_adaptive_relevance_update_process.rb +0 -1
  68. data/lib/elastic/app-search/api/search.rb +0 -1
  69. data/lib/elastic/app-search/api/search_es_search.rb +53 -0
  70. data/lib/elastic/app-search/api/search_explain.rb +61 -0
  71. data/lib/elastic/app-search/api/synonym_set.rb +0 -1
  72. data/lib/elastic/app-search/api/top_clicks_analytics.rb +0 -1
  73. data/lib/elastic/app-search/api/top_queries_analytics.rb +0 -1
  74. data/lib/elastic/enterprise-search/api/put_read_only.rb +0 -1
  75. data/lib/elastic/enterprise-search/api/version.rb +1 -1
  76. data/lib/elastic/enterprise-search/version.rb +1 -1
  77. data/spec/integration/app-search/elasticsearch_search_spec.rb +63 -0
  78. data/spec/integration/app-search/explain_search_spec.rb +59 -0
  79. metadata +14 -10
  80. data/.ci/jobs/elastic+enterprise-search-ruby+7.15.yml +0 -12
  81. data/.ci/jobs/elastic+enterprise-search-ruby+7.16.yml +0 -12
@@ -42,7 +42,6 @@ module Elastic
42
42
 
43
43
  domain_id = arguments.delete(:domain_id)
44
44
  body = arguments.delete(:body) || {}
45
-
46
45
  headers = arguments.delete(:headers) || {}
47
46
  request(
48
47
  :post,
@@ -37,7 +37,6 @@ module Elastic
37
37
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
38
38
 
39
39
  body = arguments.delete(:body) || {}
40
-
41
40
  headers = arguments.delete(:headers) || {}
42
41
  request(
43
42
  :post,
@@ -42,7 +42,6 @@ module Elastic
42
42
 
43
43
  domain_id = arguments.delete(:domain_id)
44
44
  body = arguments.delete(:body) || {}
45
-
46
45
  headers = arguments.delete(:headers) || {}
47
46
  request(
48
47
  :post,
@@ -31,7 +31,7 @@ module Elastic
31
31
  # @option body [Array<string>] :queries List of affected search queries
32
32
  # @option body [Array<string>] :promoted List of promoted document IDs
33
33
  # @option body [Array<string>] :hidden List of hidden document IDs
34
- # @option body [Hash] :suggestion
34
+ # @option body :suggestion
35
35
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
36
36
  #
37
37
  # @see https://www.elastic.co/guide/en/app-search/current/curations.html#curations-create
@@ -41,7 +41,6 @@ module Elastic
41
41
  raise ArgumentError, "Required parameter 'body (queries)' missing" unless arguments[:body]
42
42
 
43
43
  body = arguments.delete(:body) || {}
44
-
45
44
  headers = arguments.delete(:headers) || {}
46
45
  request(
47
46
  :post,
@@ -40,7 +40,6 @@ module Elastic
40
40
  raise ArgumentError, "Required parameter 'body (name)' missing" unless arguments[:body]
41
41
 
42
42
  body = arguments.delete(:body) || {}
43
-
44
43
  headers = arguments.delete(:headers) || {}
45
44
  request(
46
45
  :post,
@@ -38,7 +38,6 @@ module Elastic
38
38
  raise ArgumentError, "Required parameter 'body (synonyms)' missing" unless arguments[:body]
39
39
 
40
40
  body = arguments.delete(:body) || {}
41
-
42
41
  headers = arguments.delete(:headers) || {}
43
42
  request(
44
43
  :post,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'curation_id' missing" unless arguments[:curation_id]
37
37
 
38
38
  curation_id = arguments.delete(:curation_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :get,
@@ -34,7 +34,6 @@ module Elastic
34
34
  raise ArgumentError, "Required parameter 'api_key_name' missing" unless arguments[:api_key_name]
35
35
 
36
36
  api_key_name = arguments.delete(:api_key_name)
37
-
38
37
  headers = arguments.delete(:headers) || {}
39
38
  request(
40
39
  :delete,
@@ -39,7 +39,6 @@ module Elastic
39
39
 
40
40
  domain_id = arguments.delete(:domain_id)
41
41
  crawl_rule_id = arguments.delete(:crawl_rule_id)
42
-
43
42
  headers = arguments.delete(:headers) || {}
44
43
  request(
45
44
  :delete,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'domain_id' missing" unless arguments[:domain_id]
37
37
 
38
38
  domain_id = arguments.delete(:domain_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :delete,
@@ -39,7 +39,6 @@ module Elastic
39
39
 
40
40
  domain_id = arguments.delete(:domain_id)
41
41
  entry_point_id = arguments.delete(:entry_point_id)
42
-
43
42
  headers = arguments.delete(:headers) || {}
44
43
  request(
45
44
  :delete,
@@ -39,7 +39,6 @@ module Elastic
39
39
 
40
40
  domain_id = arguments.delete(:domain_id)
41
41
  sitemap_id = arguments.delete(:sitemap_id)
42
-
43
42
  headers = arguments.delete(:headers) || {}
44
43
  request(
45
44
  :delete,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'curation_id' missing" unless arguments[:curation_id]
37
37
 
38
38
  curation_id = arguments.delete(:curation_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :delete,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  document_ids = arguments.delete(:document_ids) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :delete,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  source_engines = arguments.delete(:source_engines) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :delete,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id]
37
37
 
38
38
  synonym_set_id = arguments.delete(:synonym_set_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :delete,
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
37
37
 
38
38
  document_ids = arguments.delete(:document_ids) || {}
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :get,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  documents = arguments.delete(:documents) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :post,
@@ -28,7 +28,7 @@ module Elastic
28
28
  # @param [Hash] arguments endpoint arguments
29
29
  # @option arguments [Hash] :body
30
30
  # @option body :page
31
- # @option body [string] :filters
31
+ # @option body [Hash] :filters
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/adaptive-relevance-api-reference.html#adaptive-relevance-api-get-engine-adaptive-relevance-suggestions
@@ -37,7 +37,6 @@ module Elastic
37
37
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
38
38
 
39
39
  body = arguments.delete(:body) || {}
40
-
41
40
  headers = arguments.delete(:headers) || {}
42
41
  request(
43
42
  :post,
@@ -40,7 +40,6 @@ module Elastic
40
40
  raise ArgumentError, "Required parameter 'body (query,document_id)' missing" unless arguments[:body]
41
41
 
42
42
  body = arguments.delete(:body) || {}
43
-
44
43
  headers = arguments.delete(:headers) || {}
45
44
  request(
46
45
  :post,
@@ -27,7 +27,7 @@ module Elastic
27
27
  # @param [String] engine_name Name of the engine (*Required*)
28
28
  # @param [Hash] arguments endpoint arguments
29
29
  # @option arguments [Hash] :body (Required: curation)
30
- # @option body [Hash] :curation (Required: )
30
+ # @option body [Hash] :curation
31
31
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
32
32
  #
33
33
  # @see https://www.elastic.co/guide/en/app-search/current/adaptive-relevance-api-reference.html#adaptive-relevance-api-put-engine-adaptive-relevance-settings
@@ -37,7 +37,6 @@ module Elastic
37
37
  raise ArgumentError, "Required parameter 'body (curation)' missing" unless arguments[:body]
38
38
 
39
39
  body = arguments.delete(:body) || {}
40
-
41
40
  headers = arguments.delete(:headers) || {}
42
41
  request(
43
42
  :put,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  body = arguments.delete(:body) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :put,
@@ -44,7 +44,6 @@ module Elastic
44
44
 
45
45
  api_key_name = arguments.delete(:api_key_name)
46
46
  body = arguments.delete(:body) || {}
47
-
48
47
  headers = arguments.delete(:headers) || {}
49
48
  request(
50
49
  :put,
@@ -48,7 +48,6 @@ module Elastic
48
48
  domain_id = arguments.delete(:domain_id)
49
49
  crawl_rule_id = arguments.delete(:crawl_rule_id)
50
50
  body = arguments.delete(:body) || {}
51
-
52
51
  headers = arguments.delete(:headers) || {}
53
52
  request(
54
53
  :put,
@@ -38,7 +38,6 @@ module Elastic
38
38
  raise ArgumentError, "Required parameter 'body (frequency,unit)' missing" unless arguments[:body]
39
39
 
40
40
  body = arguments.delete(:body) || {}
41
-
42
41
  headers = arguments.delete(:headers) || {}
43
42
  request(
44
43
  :put,
@@ -42,7 +42,6 @@ module Elastic
42
42
 
43
43
  domain_id = arguments.delete(:domain_id)
44
44
  body = arguments.delete(:body) || {}
45
-
46
45
  headers = arguments.delete(:headers) || {}
47
46
  request(
48
47
  :put,
@@ -45,7 +45,6 @@ module Elastic
45
45
  domain_id = arguments.delete(:domain_id)
46
46
  entry_point_id = arguments.delete(:entry_point_id)
47
47
  body = arguments.delete(:body) || {}
48
-
49
48
  headers = arguments.delete(:headers) || {}
50
49
  request(
51
50
  :put,
@@ -45,7 +45,6 @@ module Elastic
45
45
  domain_id = arguments.delete(:domain_id)
46
46
  sitemap_id = arguments.delete(:sitemap_id)
47
47
  body = arguments.delete(:body) || {}
48
-
49
48
  headers = arguments.delete(:headers) || {}
50
49
  request(
51
50
  :put,
@@ -32,7 +32,7 @@ module Elastic
32
32
  # @option body [Array<string>] :queries List of affected search queries
33
33
  # @option body [Array<string>] :promoted List of promoted document IDs
34
34
  # @option body [Array<string>] :hidden List of hidden document IDs
35
- # @option body [Hash] :suggestion
35
+ # @option body :suggestion
36
36
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
37
37
  #
38
38
  # @see https://www.elastic.co/guide/en/app-search/current/curations.html#curations-update
@@ -44,7 +44,6 @@ module Elastic
44
44
 
45
45
  curation_id = arguments.delete(:curation_id)
46
46
  body = arguments.delete(:body) || {}
47
-
48
47
  headers = arguments.delete(:headers) || {}
49
48
  request(
50
49
  :put,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  documents = arguments.delete(:documents) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :patch,
@@ -35,7 +35,6 @@ module Elastic
35
35
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
36
36
 
37
37
  schema = arguments.delete(:schema) || {}
38
-
39
38
  headers = arguments.delete(:headers) || {}
40
39
  request(
41
40
  :post,
@@ -39,7 +39,6 @@ module Elastic
39
39
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
40
40
 
41
41
  body = arguments.delete(:body) || {}
42
-
43
42
  headers = arguments.delete(:headers) || {}
44
43
  request(
45
44
  :put,
@@ -41,7 +41,6 @@ module Elastic
41
41
 
42
42
  synonym_set_id = arguments.delete(:synonym_set_id)
43
43
  body = arguments.delete(:body) || {}
44
-
45
44
  headers = arguments.delete(:headers) || {}
46
45
  request(
47
46
  :put,
@@ -38,7 +38,6 @@ module Elastic
38
38
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
39
39
 
40
40
  body = arguments.delete(:body) || {}
41
-
42
41
  headers = arguments.delete(:headers) || {}
43
42
  request(
44
43
  :post,
@@ -40,7 +40,6 @@ module Elastic
40
40
  end
41
41
 
42
42
  adaptive_relevance_suggestion_type = arguments.delete(:adaptive_relevance_suggestion_type)
43
-
44
43
  headers = arguments.delete(:headers) || {}
45
44
  request(
46
45
  :post,
@@ -46,7 +46,6 @@ module Elastic
46
46
  raise ArgumentError, "Required parameter 'body (query)' missing" unless arguments[:body]
47
47
 
48
48
  body = arguments.delete(:body) || {}
49
-
50
49
  headers = arguments.delete(:headers) || {}
51
50
  request(
52
51
  :post,
@@ -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
+ # ElasticsearchSearch - Run a search
25
+ # Execute the provided Elasticsearch search query against an App Search Engine
26
+ #
27
+ # @param [String] engine_name Name of the engine (*Required*)
28
+ # @param [Hash] arguments endpoint arguments
29
+ # @option arguments [Hash] :body (Required: request)
30
+ # @option body :request
31
+ # @option body :analytics
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/elasticsearch-search-api-reference.html
35
+ #
36
+ def search_es_search(engine_name, arguments = {})
37
+ raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
38
+ raise ArgumentError, "Required parameter 'body (request)' missing" unless arguments[:body]
39
+
40
+ body = arguments.delete(:body) || {}
41
+ headers = arguments.delete(:headers) || {}
42
+ request(
43
+ :post,
44
+ "api/as/v0/engines/#{engine_name}/elasticsearch/_search/",
45
+ arguments,
46
+ body,
47
+ headers
48
+ )
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,61 @@
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
+ # SearchExplain - Retrieve the search query
25
+ # Submit a search and retrieve an Elasticsearch query
26
+ #
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
+ # @option body :analytics
32
+ # @option body :boost
33
+ # @option body :facets
34
+ # @option body :filters
35
+ # @option body :group
36
+ # @option body :page
37
+ # @option body :result_fields
38
+ # @option body :search_fields
39
+ # @option body :sort
40
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
41
+ #
42
+ # @see https://www.elastic.co/guide/en/app-search/current/search-explain.html
43
+ #
44
+ def search_explain(engine_name, arguments = {})
45
+ raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
46
+ raise ArgumentError, "Required parameter 'body (query)' missing" unless arguments[:body]
47
+
48
+ body = arguments.delete(:body) || {}
49
+ headers = arguments.delete(:headers) || {}
50
+ request(
51
+ :post,
52
+ "api/as/v0/engines/#{engine_name}/search_explain/",
53
+ arguments,
54
+ body,
55
+ headers
56
+ )
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -36,7 +36,6 @@ module Elastic
36
36
  raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id]
37
37
 
38
38
  synonym_set_id = arguments.delete(:synonym_set_id)
39
-
40
39
  headers = arguments.delete(:headers) || {}
41
40
  request(
42
41
  :get,
@@ -38,7 +38,6 @@ module Elastic
38
38
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
39
39
 
40
40
  body = arguments.delete(:body) || {}
41
-
42
41
  headers = arguments.delete(:headers) || {}
43
42
  request(
44
43
  :post,
@@ -37,7 +37,6 @@ module Elastic
37
37
  raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
38
38
 
39
39
  body = arguments.delete(:body) || {}
40
-
41
40
  headers = arguments.delete(:headers) || {}
42
41
  request(
43
42
  :post,
@@ -34,7 +34,6 @@ module Elastic
34
34
  raise ArgumentError, "Required parameter 'body (enabled)' missing" unless arguments[:body]
35
35
 
36
36
  body = arguments.delete(:body) || {}
37
-
38
37
  headers = arguments.delete(:headers) || {}
39
38
  request(
40
39
  :put,
@@ -26,7 +26,7 @@ module Elastic
26
26
  # @param [Hash] arguments endpoint arguments
27
27
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
28
28
  #
29
- # @see https://www.elastic.co/guide/en/enterprise-search/current/management-apis.html
29
+ # @see https://www.elastic.co/guide/en/enterprise-search/current/monitoring-apis.html#monitoring-apis-version-api
30
30
  #
31
31
  def version(arguments = {})
32
32
  headers = arguments.delete(:headers) || {}
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
- VERSION = '8.0.0.pre'
22
+ VERSION = '8.2.0'
23
23
  end
24
24
  end
@@ -0,0 +1,63 @@
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 'Elasticsearch Search' do
24
+ let(:engine_name) { 'elasticsearch-books' }
25
+ let(:documents) do
26
+ [
27
+ { title: 'Beasts Before Us', author: 'Elsa Panciroli' },
28
+ { title: 'The Rise and Fall of the Dinosaurs', author: 'Steve Brusatte' },
29
+ { title: 'Raptor Red', author: 'Robert T. Bakker' },
30
+ { title: 'The Earth: A biography of life', author: 'Dr. Elsa Panciroli' }
31
+ ]
32
+ end
33
+ let(:api_key_name) { 'my-api-key' }
34
+
35
+ before do
36
+ # Use API Key in client, save a backup to restore original auth:
37
+ @old_client = @client.dup
38
+ api_key_body = { name: api_key_name, type: 'private', read: true, write: true, access_all_engines: true }
39
+ response = client.create_api_key(body: api_key_body)
40
+ @client.http_auth = response.body['key']
41
+ create_engine(engine_name)
42
+ client.index_documents(engine_name, documents: documents)
43
+ sleep 1
44
+ end
45
+
46
+ after do
47
+ # Restore original client:
48
+ @client = @old_client
49
+ delete_engines
50
+ client.delete_api_key(api_key_name: api_key_name)
51
+ end
52
+
53
+ it 'performs an ES search' do
54
+ es_request = { body: { query: { bool: { must: { term: { author: 'panciroli' } } } } } }
55
+ response = client.search_es_search(engine_name, body: { request: es_request })
56
+ expect(response.status).to eq 200
57
+ expect(response.body['hits']['hits'].count).to eq 2
58
+ expect do
59
+ response.body['hits']['hits'].map { |a| a['_source']['author'] } == ['Elsa Panciroli', 'Dr. Elsa Panciroli']
60
+ end
61
+ end
62
+ end
63
+ end