elastic-enterprise-search 8.1.1 → 8.3.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 (134) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/jobs/{elastic+enterprise-search-ruby+7.15.yml → elastic+enterprise-search-ruby+7.17.yml} +4 -4
  3. data/.ci/jobs/{elastic+enterprise-search-ruby+7.16.yml → elastic+enterprise-search-ruby+8.0.yml} +4 -4
  4. data/.ci/jobs/elastic+enterprise-search-ruby+8.1.yml +12 -0
  5. data/.ci/jobs/elastic+enterprise-search-ruby+8.2.yml +12 -0
  6. data/.ci/run-enterprise-search.sh +1 -0
  7. data/.ci/test-matrix.yml +1 -1
  8. data/docs/guide/app-search-api.asciidoc +21 -0
  9. data/docs/guide/connecting.asciidoc +14 -0
  10. data/docs/guide/enterprise-search-api.asciidoc +17 -2
  11. data/docs/guide/index.asciidoc +1 -1
  12. data/docs/guide/overview.asciidoc +4 -2
  13. data/docs/guide/release_notes/82.asciidoc +42 -0
  14. data/docs/guide/release_notes/index.asciidoc +3 -0
  15. data/elastic-enterprise-search.gemspec +1 -1
  16. data/lib/elastic/app-search/api/adaptive_relevance_settings.rb +1 -0
  17. data/lib/elastic/app-search/api/adaptive_relevance_suggestions.rb +2 -1
  18. data/lib/elastic/app-search/api/add_meta_engine_source.rb +1 -0
  19. data/lib/elastic/app-search/api/api_key.rb +1 -0
  20. data/lib/elastic/app-search/api/api_logs.rb +1 -0
  21. data/lib/elastic/app-search/api/count_analytics.rb +1 -0
  22. data/lib/elastic/app-search/api/crawler_active_crawl_request.rb +1 -0
  23. data/lib/elastic/app-search/api/crawler_crawl_request.rb +1 -0
  24. data/lib/elastic/app-search/api/crawler_crawl_schedule.rb +1 -0
  25. data/lib/elastic/app-search/api/crawler_domain.rb +1 -0
  26. data/lib/elastic/app-search/api/crawler_domain_validation_result.rb +1 -0
  27. data/lib/elastic/app-search/api/crawler_metrics.rb +1 -0
  28. data/lib/elastic/app-search/api/crawler_overview.rb +1 -0
  29. data/lib/elastic/app-search/api/crawler_process_crawl.rb +1 -0
  30. data/lib/elastic/app-search/api/crawler_process_crawl_denied_urls.rb +1 -0
  31. data/lib/elastic/app-search/api/crawler_url_extraction_result.rb +1 -0
  32. data/lib/elastic/app-search/api/crawler_url_tracing_result.rb +1 -0
  33. data/lib/elastic/app-search/api/crawler_url_validation_result.rb +1 -0
  34. data/lib/elastic/app-search/api/crawler_user_agent.rb +1 -0
  35. data/lib/elastic/app-search/api/create_api_key.rb +1 -0
  36. data/lib/elastic/app-search/api/create_crawler_crawl_request.rb +1 -0
  37. data/lib/elastic/app-search/api/create_crawler_crawl_rule.rb +1 -0
  38. data/lib/elastic/app-search/api/create_crawler_domain.rb +1 -0
  39. data/lib/elastic/app-search/api/create_crawler_entry_point.rb +1 -0
  40. data/lib/elastic/app-search/api/create_crawler_process_crawl.rb +1 -0
  41. data/lib/elastic/app-search/api/create_crawler_sitemap.rb +1 -0
  42. data/lib/elastic/app-search/api/create_curation.rb +2 -1
  43. data/lib/elastic/app-search/api/create_engine.rb +1 -0
  44. data/lib/elastic/app-search/api/create_synonym_set.rb +1 -0
  45. data/lib/elastic/app-search/api/curation.rb +1 -0
  46. data/lib/elastic/app-search/api/delete_api_key.rb +1 -0
  47. data/lib/elastic/app-search/api/delete_crawler_active_crawl_request.rb +1 -0
  48. data/lib/elastic/app-search/api/delete_crawler_crawl_rule.rb +1 -0
  49. data/lib/elastic/app-search/api/delete_crawler_crawl_schedule.rb +1 -0
  50. data/lib/elastic/app-search/api/delete_crawler_domain.rb +1 -0
  51. data/lib/elastic/app-search/api/delete_crawler_entry_point.rb +1 -0
  52. data/lib/elastic/app-search/api/delete_crawler_sitemap.rb +1 -0
  53. data/lib/elastic/app-search/api/delete_curation.rb +1 -0
  54. data/lib/elastic/app-search/api/delete_documents.rb +1 -0
  55. data/lib/elastic/app-search/api/delete_engine.rb +1 -0
  56. data/lib/elastic/app-search/api/delete_meta_engine_source.rb +1 -0
  57. data/lib/elastic/app-search/api/delete_synonym_set.rb +1 -0
  58. data/lib/elastic/app-search/api/documents.rb +1 -0
  59. data/lib/elastic/app-search/api/engine.rb +1 -0
  60. data/lib/elastic/app-search/api/index_documents.rb +1 -0
  61. data/lib/elastic/app-search/api/list_adaptive_relevance_suggestions.rb +2 -1
  62. data/lib/elastic/app-search/api/list_api_keys.rb +1 -0
  63. data/lib/elastic/app-search/api/list_crawler_crawl_requests.rb +1 -0
  64. data/lib/elastic/app-search/api/list_crawler_domains.rb +1 -0
  65. data/lib/elastic/app-search/api/list_crawler_process_crawls.rb +1 -0
  66. data/lib/elastic/app-search/api/list_curations.rb +1 -0
  67. data/lib/elastic/app-search/api/list_documents.rb +1 -0
  68. data/lib/elastic/app-search/api/list_engines.rb +1 -0
  69. data/lib/elastic/app-search/api/list_synonym_sets.rb +1 -0
  70. data/lib/elastic/app-search/api/log_clickthrough.rb +1 -0
  71. data/lib/elastic/app-search/api/multi_search.rb +8 -6
  72. data/lib/elastic/app-search/api/put_adaptive_relevance_settings.rb +2 -1
  73. data/lib/elastic/app-search/api/put_adaptive_relevance_suggestions.rb +1 -0
  74. data/lib/elastic/app-search/api/put_api_key.rb +1 -0
  75. data/lib/elastic/app-search/api/put_crawler_crawl_rule.rb +1 -0
  76. data/lib/elastic/app-search/api/put_crawler_crawl_schedule.rb +1 -0
  77. data/lib/elastic/app-search/api/put_crawler_domain.rb +1 -0
  78. data/lib/elastic/app-search/api/put_crawler_entry_point.rb +1 -0
  79. data/lib/elastic/app-search/api/put_crawler_sitemap.rb +1 -0
  80. data/lib/elastic/app-search/api/put_curation.rb +2 -1
  81. data/lib/elastic/app-search/api/put_documents.rb +1 -0
  82. data/lib/elastic/app-search/api/put_schema.rb +1 -0
  83. data/lib/elastic/app-search/api/put_search_settings.rb +1 -0
  84. data/lib/elastic/app-search/api/put_synonym_set.rb +1 -0
  85. data/lib/elastic/app-search/api/query_suggestion.rb +1 -0
  86. data/lib/elastic/app-search/api/refresh_adaptive_relevance_update_process.rb +1 -0
  87. data/lib/elastic/app-search/api/reset_search_settings.rb +1 -0
  88. data/lib/elastic/app-search/api/schema.rb +1 -0
  89. data/lib/elastic/app-search/api/search.rb +1 -0
  90. data/lib/elastic/app-search/api/search_es_search.rb +54 -0
  91. data/lib/elastic/app-search/api/search_explain.rb +62 -0
  92. data/lib/elastic/app-search/api/search_settings.rb +1 -0
  93. data/lib/elastic/app-search/api/synonym_set.rb +1 -0
  94. data/lib/elastic/app-search/api/top_clicks_analytics.rb +1 -0
  95. data/lib/elastic/app-search/api/top_queries_analytics.rb +1 -0
  96. data/lib/elastic/enterprise-search/api/health.rb +1 -0
  97. data/lib/elastic/enterprise-search/api/put_read_only.rb +1 -0
  98. data/lib/elastic/enterprise-search/api/read_only.rb +1 -0
  99. data/lib/elastic/enterprise-search/api/search_engines.rb +44 -0
  100. data/lib/elastic/enterprise-search/api/stats.rb +1 -0
  101. data/lib/elastic/enterprise-search/api/version.rb +2 -1
  102. data/lib/elastic/enterprise-search/version.rb +1 -1
  103. data/lib/elastic/workplace-search/api/auto_query_refinement_details.rb +1 -0
  104. data/lib/elastic/workplace-search/api/command_sync_jobs.rb +1 -0
  105. data/lib/elastic/workplace-search/api/content_source.rb +1 -0
  106. data/lib/elastic/workplace-search/api/create_analytics_event.rb +1 -0
  107. data/lib/elastic/workplace-search/api/create_batch_synonym_sets.rb +1 -0
  108. data/lib/elastic/workplace-search/api/create_content_source.rb +1 -0
  109. data/lib/elastic/workplace-search/api/create_external_identity.rb +1 -0
  110. data/lib/elastic/workplace-search/api/current_user.rb +1 -0
  111. data/lib/elastic/workplace-search/api/delete_content_source.rb +1 -0
  112. data/lib/elastic/workplace-search/api/delete_documents.rb +1 -0
  113. data/lib/elastic/workplace-search/api/delete_documents_by_query.rb +1 -0
  114. data/lib/elastic/workplace-search/api/delete_external_identity.rb +1 -0
  115. data/lib/elastic/workplace-search/api/delete_synonym_set.rb +1 -0
  116. data/lib/elastic/workplace-search/api/document.rb +1 -0
  117. data/lib/elastic/workplace-search/api/external_identity.rb +1 -0
  118. data/lib/elastic/workplace-search/api/index_documents.rb +1 -0
  119. data/lib/elastic/workplace-search/api/list_content_sources.rb +1 -0
  120. data/lib/elastic/workplace-search/api/list_documents.rb +1 -0
  121. data/lib/elastic/workplace-search/api/list_external_identities.rb +1 -0
  122. data/lib/elastic/workplace-search/api/list_synonym_sets.rb +1 -0
  123. data/lib/elastic/workplace-search/api/put_content_source.rb +1 -0
  124. data/lib/elastic/workplace-search/api/put_content_source_icons.rb +1 -0
  125. data/lib/elastic/workplace-search/api/put_external_identity.rb +1 -0
  126. data/lib/elastic/workplace-search/api/put_synonym_set.rb +1 -0
  127. data/lib/elastic/workplace-search/api/put_triggers_blocklist.rb +1 -0
  128. data/lib/elastic/workplace-search/api/search.rb +1 -0
  129. data/lib/elastic/workplace-search/api/synonym_set.rb +1 -0
  130. data/lib/elastic/workplace-search/api/triggers_blocklist.rb +1 -0
  131. data/spec/integration/app-search/elasticsearch_search_spec.rb +63 -0
  132. data/spec/integration/app-search/explain_search_spec.rb +59 -0
  133. data/spec/integration/enterprise_search_api_spec.rb +11 -0
  134. metadata +16 -8
@@ -19,6 +19,7 @@
19
19
 
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
22
23
  module Actions
23
24
  # Version - Get version information for this server
24
25
  # Get version information for this server
@@ -26,7 +27,7 @@ module Elastic
26
27
  # @param [Hash] arguments endpoint arguments
27
28
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
28
29
  #
29
- # @see https://www.elastic.co/guide/en/enterprise-search/current/management-apis.html
30
+ # @see https://www.elastic.co/guide/en/enterprise-search/current/monitoring-apis.html#monitoring-apis-version-api
30
31
  #
31
32
  def version(arguments = {})
32
33
  headers = arguments.delete(:headers) || {}
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
- VERSION = '8.1.1'
22
+ VERSION = '8.3.0'
23
23
  end
24
24
  end
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # ContentSources - Retrieves a content source's automatic query refinement details
25
26
  # Retrieves a content source's automatic query refinement details
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # SyncJobs - Issue commands to a Content Source's sync jobs
25
26
  # Control a content source's sync jobs
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # ContentSources - Retrieves a content source by ID
25
26
  # Retrieves a content source by ID
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # Analytics - Capture click and feedback analytic events
25
26
  # Capture Analytic events for click and feedback
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # Synonyms - Create a batch of synonym sets
25
26
  # Create batched synonym sets
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # ContentSources - Create a content source
25
26
  # Create a custom content source
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # ExternalIdentities - Adds a new external identity
25
26
  # Adds a new external identity
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # getCurrentUser - Get the authenticated user
25
26
  # Get the authenticated user
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # ContentSources - Deletes a content source by ID
25
26
  # Deletes a content source by ID
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # Documents - Deletes a list of documents from a custom content source
25
26
  # Remove documents from a Custom API Source
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # Documents - Deletes documents by query in a custom content source
25
26
  # Deletes documents by query in a custom content source
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # ExternalIdentities - Deletes an external identity
25
26
  # Deletes an external identity
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # Synonyms - Delete a synonym set
25
26
  # Delete a synonym set
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # Documents - Retrieves a document by ID from the specified content source
25
26
  # Retrieves a document by ID from the specified content source
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # ExternalIdentities - Retrieves an external identity
25
26
  # Retrieves an external identity
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # Documents - Indexes one or more new documents into a custom content source, or updates one or more existing documents
25
26
  # Indexes one or more new documents into a custom content source, or updates one or more existing documents
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # ContentSources - Retrieves all content sources
25
26
  # Retrieves all content sources
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # Documents - Lists documents from a custom content source
25
26
  # Lists documents from a custom content source
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # ExternalIdentities - Retrieves all external identities
25
26
  # Retrieves all external identities
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # Synonyms - Retrieves all synonym sets
25
26
  # Retrieve a list of synonym sets
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # ContentSources - Update a content source
25
26
  # Update a content source
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # ContentSources - Upload content source icons
25
26
  # Upload content source icons
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # ExternalIdentities - Updates an external identity
25
26
  # Updates an external identity
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # Synonyms - Update a synonym set
25
26
  # Update a synonym set
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # putTriggersBlocklist - Update current triggers blocklist
25
26
  # Update current triggers blocklist
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # Search - Search across available sources with various query tuning options
25
26
  # Issue a Search Query
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # Synonyms - Retrieve a synonym set by ID
25
26
  # Retrieve a synonym set by ID
@@ -20,6 +20,7 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
+ # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
23
24
  module Actions
24
25
  # getTriggersBlocklist - Get current triggers blocklist
25
26
  # Get current triggers blocklist
@@ -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
@@ -0,0 +1,59 @@
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) { 'app-search-explain' }
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 'explains a Search query' do
54
+ response = client.search_explain(engine_name, body: { query: 'Raptor Red' })
55
+ expect(response.status).to eq 200
56
+ expect(response.body['query_string']).to eq 'GET enterprise-search-engine-app-search-explain/_search'
57
+ end
58
+ end
59
+ end
@@ -97,4 +97,15 @@ describe Elastic::EnterpriseSearch::Client do
97
97
  end
98
98
  end
99
99
  end
100
+
101
+ context 'unversioned API' do
102
+ context 'search_engines' do
103
+ it 'makes GET request' do
104
+ response = client.search_engines
105
+
106
+ expect(response.status).to eq 200
107
+ expect(response.body['results'])
108
+ end
109
+ end
110
+ end
100
111
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-enterprise-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.1
4
+ version: 8.3.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: 2022-05-23 00:00:00.000000000 Z
11
+ date: 2022-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: elastic-transport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 8.0.0.pre.1
19
+ version: '8'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 8.0.0.pre.1
26
+ version: '8'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jwt
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -164,8 +164,10 @@ files:
164
164
  - ".ci/functions/imports.sh"
165
165
  - ".ci/functions/wait-for-container.sh"
166
166
  - ".ci/jobs/defaults.yml"
167
- - ".ci/jobs/elastic+enterprise-search-ruby+7.15.yml"
168
- - ".ci/jobs/elastic+enterprise-search-ruby+7.16.yml"
167
+ - ".ci/jobs/elastic+enterprise-search-ruby+7.17.yml"
168
+ - ".ci/jobs/elastic+enterprise-search-ruby+8.0.yml"
169
+ - ".ci/jobs/elastic+enterprise-search-ruby+8.1.yml"
170
+ - ".ci/jobs/elastic+enterprise-search-ruby+8.2.yml"
169
171
  - ".ci/jobs/elastic+enterprise-search-ruby+main.yml"
170
172
  - ".ci/jobs/elastic+enterprise-search-ruby+pull-request.yml"
171
173
  - ".ci/make.sh"
@@ -207,6 +209,7 @@ files:
207
209
  - docs/guide/release_notes/717.asciidoc
208
210
  - docs/guide/release_notes/80.asciidoc
209
211
  - docs/guide/release_notes/81.asciidoc
212
+ - docs/guide/release_notes/82.asciidoc
210
213
  - docs/guide/release_notes/index.asciidoc
211
214
  - docs/guide/workplace-search-api.asciidoc
212
215
  - elastic-enterprise-search.gemspec
@@ -290,6 +293,8 @@ files:
290
293
  - lib/elastic/app-search/api/reset_search_settings.rb
291
294
  - lib/elastic/app-search/api/schema.rb
292
295
  - lib/elastic/app-search/api/search.rb
296
+ - lib/elastic/app-search/api/search_es_search.rb
297
+ - lib/elastic/app-search/api/search_explain.rb
293
298
  - lib/elastic/app-search/api/search_settings.rb
294
299
  - lib/elastic/app-search/api/synonym_set.rb
295
300
  - lib/elastic/app-search/api/top_clicks_analytics.rb
@@ -298,6 +303,7 @@ files:
298
303
  - lib/elastic/enterprise-search/api/health.rb
299
304
  - lib/elastic/enterprise-search/api/put_read_only.rb
300
305
  - lib/elastic/enterprise-search/api/read_only.rb
306
+ - lib/elastic/enterprise-search/api/search_engines.rb
301
307
  - lib/elastic/enterprise-search/api/stats.rb
302
308
  - lib/elastic/enterprise-search/api/version.rb
303
309
  - lib/elastic/enterprise-search/client.rb
@@ -366,7 +372,9 @@ files:
366
372
  - spec/integration/app-search/crawler_user_agent_spec.rb
367
373
  - spec/integration/app-search/curations_spec.rb
368
374
  - spec/integration/app-search/documents_spec.rb
375
+ - spec/integration/app-search/elasticsearch_search_spec.rb
369
376
  - spec/integration/app-search/engines_spec.rb
377
+ - spec/integration/app-search/explain_search_spec.rb
370
378
  - spec/integration/app-search/log_clickthrough_spec.rb
371
379
  - spec/integration/app-search/meta_engines_spec.rb
372
380
  - spec/integration/app-search/query_suggestion_spec.rb