elastic-enterprise-search 8.3.0 → 8.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/Dockerfile +14 -1
  3. data/.ci/jobs/{elastic+enterprise-search-ruby+8.0.yml → elastic+enterprise-search-ruby+8.3.yml} +4 -4
  4. data/.ci/jobs/{elastic+enterprise-search-ruby+8.1.yml → elastic+enterprise-search-ruby+8.4.yml} +4 -4
  5. data/.ci/make.sh +3 -1
  6. data/.ci/test-matrix.yml +1 -1
  7. data/.github/workflows/rubocop.yml +2 -2
  8. data/.github/workflows/testing.yml +2 -0
  9. data/README.md +1 -1
  10. data/docs/guide/app-search-api.asciidoc +4 -3
  11. data/docs/guide/installation.asciidoc +2 -2
  12. data/docs/guide/overview.asciidoc +2 -2
  13. data/docs/guide/release_notes/83.asciidoc +14 -0
  14. data/docs/guide/release_notes/84.asciidoc +36 -0
  15. data/docs/guide/release_notes/85.asciidoc +40 -0
  16. data/docs/guide/release_notes/index.asciidoc +6 -0
  17. data/elastic-enterprise-search.gemspec +6 -1
  18. data/lib/elastic/app-search/api/adaptive_relevance_settings.rb +0 -1
  19. data/lib/elastic/app-search/api/adaptive_relevance_suggestions.rb +0 -1
  20. data/lib/elastic/app-search/api/add_meta_engine_source.rb +0 -1
  21. data/lib/elastic/app-search/api/api_key.rb +0 -1
  22. data/lib/elastic/app-search/api/api_logs.rb +0 -1
  23. data/lib/elastic/app-search/api/count_analytics.rb +0 -1
  24. data/lib/elastic/app-search/api/crawler_active_crawl_request.rb +0 -1
  25. data/lib/elastic/app-search/api/crawler_crawl_request.rb +0 -1
  26. data/lib/elastic/app-search/api/crawler_crawl_schedule.rb +0 -1
  27. data/lib/elastic/app-search/api/crawler_domain.rb +0 -1
  28. data/lib/elastic/app-search/api/crawler_domain_validation_result.rb +0 -1
  29. data/lib/elastic/app-search/api/crawler_metrics.rb +0 -1
  30. data/lib/elastic/app-search/api/crawler_overview.rb +0 -1
  31. data/lib/elastic/app-search/api/crawler_process_crawl.rb +0 -1
  32. data/lib/elastic/app-search/api/crawler_process_crawl_denied_urls.rb +0 -1
  33. data/lib/elastic/app-search/api/crawler_url_extraction_result.rb +0 -1
  34. data/lib/elastic/app-search/api/crawler_url_tracing_result.rb +0 -1
  35. data/lib/elastic/app-search/api/crawler_url_validation_result.rb +0 -1
  36. data/lib/elastic/app-search/api/crawler_user_agent.rb +0 -1
  37. data/lib/elastic/app-search/api/create_api_key.rb +0 -1
  38. data/lib/elastic/app-search/api/create_crawler_crawl_request.rb +0 -1
  39. data/lib/elastic/app-search/api/create_crawler_crawl_rule.rb +0 -1
  40. data/lib/elastic/app-search/api/create_crawler_domain.rb +0 -1
  41. data/lib/elastic/app-search/api/create_crawler_entry_point.rb +0 -1
  42. data/lib/elastic/app-search/api/create_crawler_process_crawl.rb +0 -1
  43. data/lib/elastic/app-search/api/create_crawler_sitemap.rb +0 -1
  44. data/lib/elastic/app-search/api/create_curation.rb +0 -1
  45. data/lib/elastic/app-search/api/create_engine.rb +0 -1
  46. data/lib/elastic/app-search/api/create_synonym_set.rb +0 -1
  47. data/lib/elastic/app-search/api/curation.rb +0 -1
  48. data/lib/elastic/app-search/api/delete_api_key.rb +0 -1
  49. data/lib/elastic/app-search/api/delete_crawler_active_crawl_request.rb +0 -1
  50. data/lib/elastic/app-search/api/delete_crawler_crawl_rule.rb +0 -1
  51. data/lib/elastic/app-search/api/delete_crawler_crawl_schedule.rb +0 -1
  52. data/lib/elastic/app-search/api/delete_crawler_domain.rb +0 -1
  53. data/lib/elastic/app-search/api/delete_crawler_entry_point.rb +0 -1
  54. data/lib/elastic/app-search/api/delete_crawler_sitemap.rb +0 -1
  55. data/lib/elastic/app-search/api/delete_curation.rb +0 -1
  56. data/lib/elastic/app-search/api/delete_documents.rb +0 -1
  57. data/lib/elastic/app-search/api/delete_engine.rb +0 -1
  58. data/lib/elastic/app-search/api/delete_meta_engine_source.rb +0 -1
  59. data/lib/elastic/app-search/api/delete_synonym_set.rb +0 -1
  60. data/lib/elastic/app-search/api/documents.rb +0 -1
  61. data/lib/elastic/app-search/api/engine.rb +0 -1
  62. data/lib/elastic/app-search/api/index_documents.rb +0 -1
  63. data/lib/elastic/app-search/api/list_adaptive_relevance_suggestions.rb +0 -1
  64. data/lib/elastic/app-search/api/list_api_keys.rb +0 -1
  65. data/lib/elastic/app-search/api/list_crawler_crawl_requests.rb +0 -1
  66. data/lib/elastic/app-search/api/list_crawler_domains.rb +0 -1
  67. data/lib/elastic/app-search/api/list_crawler_process_crawls.rb +0 -1
  68. data/lib/elastic/app-search/api/list_curations.rb +0 -1
  69. data/lib/elastic/app-search/api/list_documents.rb +0 -1
  70. data/lib/elastic/app-search/api/list_engines.rb +0 -1
  71. data/lib/elastic/app-search/api/list_synonym_sets.rb +0 -1
  72. data/lib/elastic/app-search/api/log_clickthrough.rb +0 -1
  73. data/lib/elastic/app-search/api/multi_search.rb +0 -1
  74. data/lib/elastic/app-search/api/put_adaptive_relevance_settings.rb +0 -1
  75. data/lib/elastic/app-search/api/put_adaptive_relevance_suggestions.rb +0 -1
  76. data/lib/elastic/app-search/api/put_api_key.rb +0 -1
  77. data/lib/elastic/app-search/api/put_crawler_crawl_rule.rb +0 -1
  78. data/lib/elastic/app-search/api/put_crawler_crawl_schedule.rb +0 -1
  79. data/lib/elastic/app-search/api/put_crawler_domain.rb +0 -1
  80. data/lib/elastic/app-search/api/put_crawler_entry_point.rb +0 -1
  81. data/lib/elastic/app-search/api/put_crawler_sitemap.rb +0 -1
  82. data/lib/elastic/app-search/api/put_curation.rb +0 -1
  83. data/lib/elastic/app-search/api/put_documents.rb +0 -1
  84. data/lib/elastic/app-search/api/put_schema.rb +0 -1
  85. data/lib/elastic/app-search/api/put_search_settings.rb +1 -1
  86. data/lib/elastic/app-search/api/put_synonym_set.rb +0 -1
  87. data/lib/elastic/app-search/api/query_suggestion.rb +0 -1
  88. data/lib/elastic/app-search/api/refresh_adaptive_relevance_update_process.rb +0 -1
  89. data/lib/elastic/app-search/api/reset_search_settings.rb +0 -1
  90. data/lib/elastic/app-search/api/schema.rb +0 -1
  91. data/lib/elastic/app-search/api/search.rb +0 -1
  92. data/lib/elastic/app-search/api/search_es_search.rb +5 -6
  93. data/lib/elastic/app-search/api/search_explain.rb +1 -2
  94. data/lib/elastic/app-search/api/search_settings.rb +0 -1
  95. data/lib/elastic/app-search/api/synonym_set.rb +0 -1
  96. data/lib/elastic/app-search/api/top_clicks_analytics.rb +0 -1
  97. data/lib/elastic/app-search/api/top_queries_analytics.rb +0 -1
  98. data/lib/elastic/enterprise-search/api/health.rb +0 -1
  99. data/lib/elastic/enterprise-search/api/put_read_only.rb +0 -1
  100. data/lib/elastic/enterprise-search/api/read_only.rb +0 -1
  101. data/lib/elastic/enterprise-search/api/search_engines.rb +0 -1
  102. data/lib/elastic/enterprise-search/api/stats.rb +0 -1
  103. data/lib/elastic/enterprise-search/api/version.rb +0 -1
  104. data/lib/elastic/enterprise-search/request.rb +1 -1
  105. data/lib/elastic/enterprise-search/version.rb +1 -1
  106. data/lib/elastic/workplace-search/api/auto_query_refinement_details.rb +0 -1
  107. data/lib/elastic/workplace-search/api/command_sync_jobs.rb +0 -1
  108. data/lib/elastic/workplace-search/api/content_source.rb +0 -1
  109. data/lib/elastic/workplace-search/api/create_analytics_event.rb +0 -1
  110. data/lib/elastic/workplace-search/api/create_batch_synonym_sets.rb +0 -1
  111. data/lib/elastic/workplace-search/api/create_content_source.rb +0 -1
  112. data/lib/elastic/workplace-search/api/create_external_identity.rb +0 -1
  113. data/lib/elastic/workplace-search/api/current_user.rb +0 -1
  114. data/lib/elastic/workplace-search/api/delete_content_source.rb +0 -1
  115. data/lib/elastic/workplace-search/api/delete_documents.rb +0 -1
  116. data/lib/elastic/workplace-search/api/delete_documents_by_query.rb +0 -1
  117. data/lib/elastic/workplace-search/api/delete_external_identity.rb +0 -1
  118. data/lib/elastic/workplace-search/api/delete_synonym_set.rb +0 -1
  119. data/lib/elastic/workplace-search/api/document.rb +0 -1
  120. data/lib/elastic/workplace-search/api/external_identity.rb +0 -1
  121. data/lib/elastic/workplace-search/api/index_documents.rb +0 -1
  122. data/lib/elastic/workplace-search/api/list_content_sources.rb +0 -1
  123. data/lib/elastic/workplace-search/api/list_documents.rb +0 -1
  124. data/lib/elastic/workplace-search/api/list_external_identities.rb +0 -1
  125. data/lib/elastic/workplace-search/api/list_synonym_sets.rb +0 -1
  126. data/lib/elastic/workplace-search/api/put_content_source.rb +0 -1
  127. data/lib/elastic/workplace-search/api/put_content_source_icons.rb +0 -1
  128. data/lib/elastic/workplace-search/api/put_external_identity.rb +0 -1
  129. data/lib/elastic/workplace-search/api/put_synonym_set.rb +0 -1
  130. data/lib/elastic/workplace-search/api/put_triggers_blocklist.rb +0 -1
  131. data/lib/elastic/workplace-search/api/search.rb +0 -1
  132. data/lib/elastic/workplace-search/api/synonym_set.rb +0 -1
  133. data/lib/elastic/workplace-search/api/triggers_blocklist.rb +0 -1
  134. data/rake_tasks/unified_release_tasks.rake +21 -0
  135. data/spec/app-search/client_spec.rb +1 -28
  136. data/spec/enterprise-search/client_spec.rb +1 -28
  137. data/spec/fixtures/vcr/workplace_search/create_analytics_event.yml +1 -1
  138. data/spec/fixtures/vcr/workplace_search/oauth_request_token.yml +1 -1
  139. data/spec/fixtures/vcr/workplace_search/search_request.yml +1 -1
  140. data/spec/integration/app-search/elasticsearch_search_spec.rb +17 -3
  141. data/spec/spec_helper.rb +34 -0
  142. data/spec/workplace-search/client_spec.rb +1 -28
  143. metadata +65 -6
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # Documents - Deletes a list of documents from a custom content source
26
25
  # Remove documents from a Custom API Source
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # Documents - Deletes documents by query in a custom content source
26
25
  # Deletes documents by query in a custom content source
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # ExternalIdentities - Deletes an external identity
26
25
  # Deletes an external identity
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # Synonyms - Delete a synonym set
26
25
  # Delete a synonym set
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # Documents - Retrieves a document by ID from the specified content source
26
25
  # Retrieves a document by ID from the specified content source
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # ExternalIdentities - Retrieves an external identity
26
25
  # Retrieves an external identity
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # Documents - Indexes one or more new documents into a custom content source, or updates one or more existing documents
26
25
  # Indexes one or more new documents into a custom content source, or updates one or more existing documents
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # ContentSources - Retrieves all content sources
26
25
  # Retrieves all content sources
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # Documents - Lists documents from a custom content source
26
25
  # Lists documents from a custom content source
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # ExternalIdentities - Retrieves all external identities
26
25
  # Retrieves all external identities
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # Synonyms - Retrieves all synonym sets
26
25
  # Retrieve a list of synonym sets
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # ContentSources - Update a content source
26
25
  # Update a content source
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # ContentSources - Upload content source icons
26
25
  # Upload content source icons
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # ExternalIdentities - Updates an external identity
26
25
  # Updates an external identity
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # Synonyms - Update a synonym set
26
25
  # Update a synonym set
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # putTriggersBlocklist - Update current triggers blocklist
26
25
  # Update current triggers blocklist
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # Search - Search across available sources with various query tuning options
26
25
  # Issue a Search Query
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # Synonyms - Retrieve a synonym set by ID
26
25
  # Retrieve a synonym set by ID
@@ -20,7 +20,6 @@
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
22
  module WorkplaceSearch
23
- # Generated from build hash 835a1a87f357f7b7cfd3453b5c5a937c47995772
24
23
  module Actions
25
24
  # getTriggersBlocklist - Get current triggers blocklist
26
25
  # Get current triggers blocklist
@@ -17,6 +17,7 @@
17
17
 
18
18
  # frozen_string_literal: true
19
19
 
20
+ # rubocop:disable Metrics/BlockLength
20
21
  namespace :unified_release do
21
22
  desc <<-DESC
22
23
  Update Rubygems versions in version.rb and *.gemspec files
@@ -43,4 +44,24 @@ namespace :unified_release do
43
44
  rescue StandardError => e
44
45
  abort "[!!!] #{e.class} : #{e.message}"
45
46
  end
47
+
48
+ desc 'Update Stack Versions in test matrices (.github/workflows and .ci/test-matrix.yml)'
49
+ task :update_matrices, :version do |_, args|
50
+ @version = args[:version]
51
+ error = 'Error: version must be passed in and needs to be a version format: 9.1.0, 8.7.15.'
52
+ raise ArgumentError, error unless @version&.match?(/[0-9.]/)
53
+
54
+ # Replace in test-matrix.yml
55
+ file = File.expand_path('./.ci/test-matrix.yml')
56
+ regex = /(STACK_VERSION:\s+- )([0-9.]+(-SNAPSHOT)?)/
57
+ replace_version(regex, file)
58
+ end
59
+
60
+ def replace_version(regex, file)
61
+ content = File.read(file)
62
+ match = content.match(regex)
63
+ content = content.gsub(regex, "#{match[1]}#{@version}")
64
+ File.open(file, 'w') { |f| f.puts content }
65
+ end
46
66
  end
67
+ # rubocop:enable Metrics/BlockLength
@@ -86,32 +86,5 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
86
86
  end
87
87
  end
88
88
 
89
- context 'adapters' do
90
- let(:client) { described_class.new }
91
- let(:adapter) { client.transport.transport.connections.all.first.connection.builder.adapter }
92
-
93
- context 'when no adapter is specified' do
94
- it 'uses Faraday NetHttp' do
95
- expect(adapter).to eq Faraday::Adapter::NetHttp
96
- end
97
- end
98
-
99
- context 'when the adapter is patron' do
100
- let(:client) { described_class.new(adapter: :patron) }
101
-
102
- it 'uses Faraday with the adapter' do
103
- expect(adapter).to eq Faraday::Adapter::Patron
104
- end
105
- end
106
-
107
- unless defined?(JRUBY_VERSION)
108
- context 'when the adapter is typhoeus' do
109
- let(:client) { described_class.new(adapter: :patron) }
110
-
111
- it 'uses Faraday with the adapter' do
112
- expect(adapter).to eq Faraday::Adapter::Patron
113
- end
114
- end
115
- end
116
- end
89
+ include_examples 'adapters compatibility'
117
90
  end
@@ -104,32 +104,5 @@ describe Elastic::EnterpriseSearch::Client do
104
104
  end
105
105
  end
106
106
 
107
- context 'adapters' do
108
- let(:client) { described_class.new }
109
- let(:adapter) { client.transport.transport.connections.all.first.connection.builder.adapter }
110
-
111
- context 'when no adapter is specified' do
112
- it 'uses Faraday NetHttp' do
113
- expect(adapter).to eq Faraday::Adapter::NetHttp
114
- end
115
- end
116
-
117
- context 'when the adapter is patron' do
118
- let(:client) { described_class.new(adapter: :patron) }
119
-
120
- it 'uses Faraday with the adapter' do
121
- expect(adapter).to eq Faraday::Adapter::Patron
122
- end
123
- end
124
-
125
- unless defined?(JRUBY_VERSION)
126
- context 'when the adapter is typhoeus' do
127
- let(:client) { described_class.new(adapter: :patron) }
128
-
129
- it 'uses Faraday with the adapter' do
130
- expect(adapter).to eq Faraday::Adapter::Patron
131
- end
132
- end
133
- end
134
- end
107
+ include_examples 'adapters compatibility'
135
108
  end
@@ -10,7 +10,7 @@ http_interactions:
10
10
  X-Elastic-Client-Meta:
11
11
  - es=7.11.0.pre.1,rb=2.7.2,t=7.11.0.pre.1,fd=1.3.0,nh=1.1
12
12
  User-Agent:
13
- - 'elastic-enteprise-search-ruby/7.11.0.pre (RUBY_VERSION: 2.7.2; linux x86_64;
13
+ - 'elastic-enterprise-search-ruby/7.11.0.pre (RUBY_VERSION: 2.7.2; linux x86_64;
14
14
  elasticsearch-transport: 7.11.0.pre.1)'
15
15
  Content-Type:
16
16
  - application/json
@@ -10,7 +10,7 @@ http_interactions:
10
10
  X-Elastic-Client-Meta:
11
11
  - es=7.11.0.pre.1,rb=2.7.2,t=7.11.0.pre.1,fd=1.3.0,nh=1.1
12
12
  User-Agent:
13
- - 'elastic-enteprise-search-ruby/7.11.0.pre (RUBY_VERSION: 2.7.2; linux x86_64;
13
+ - 'elastic-enterprise-search-ruby/7.11.0.pre (RUBY_VERSION: 2.7.2; linux x86_64;
14
14
  elasticsearch-transport: 7.11.0.pre.1)'
15
15
  Content-Type:
16
16
  - application/json
@@ -10,7 +10,7 @@ http_interactions:
10
10
  X-Elastic-Client-Meta:
11
11
  - es=7.11.0.pre.1,rb=2.7.2,t=7.11.0.pre.1,fd=1.3.0,nh=1.1
12
12
  User-Agent:
13
- - 'elastic-enteprise-search-ruby/7.11.0.pre (RUBY_VERSION: 2.7.2; linux x86_64;
13
+ - 'elastic-enterprise-search-ruby/7.11.0.pre (RUBY_VERSION: 2.7.2; linux x86_64;
14
14
  elasticsearch-transport: 7.11.0.pre.1)'
15
15
  Content-Type:
16
16
  - application/json
@@ -51,12 +51,26 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
51
51
  end
52
52
 
53
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 })
54
+ es_request = { query: { bool: { must: { term: { author: 'panciroli' } } } } }
55
+ response = client.search_es_search(engine_name, body: es_request)
56
56
  expect(response.status).to eq 200
57
57
  expect(response.body['hits']['hits'].count).to eq 2
58
58
  expect do
59
- response.body['hits']['hits'].map { |a| a['_source']['author'] } == ['Elsa Panciroli', 'Dr. Elsa Panciroli']
59
+ response.body['hits']['hits'].map do |a|
60
+ a['_source']['author']
61
+ end == ['Elsa Panciroli', 'Dr. Elsa Panciroli']
62
+ end
63
+ end
64
+
65
+ it 'performs an ES search with query parameters' do
66
+ es_request = { query: { bool: { must: { term: { author: 'panciroli' } } } } }
67
+ response = client.search_es_search(engine_name, body: es_request, sort: "{ 'author': 'desc' }")
68
+ expect(response.status).to eq 200
69
+ expect(response.body['hits']['hits'].count).to eq 2
70
+ expect do
71
+ response.body['hits']['hits'].map do |a|
72
+ a['_source']['author']
73
+ end == ['Dr. Elsa Panciroli', 'Elsa Panciroli']
60
74
  end
61
75
  end
62
76
  end
data/spec/spec_helper.rb CHANGED
@@ -39,3 +39,37 @@ RSpec.configure do |config|
39
39
  c.allow_http_connections_when_no_cassette = true
40
40
  end
41
41
  end
42
+
43
+ def is_faraday2?
44
+ return false unless defined?(Faraday::VERSION)
45
+
46
+ Gem::Version.new(Faraday::VERSION) >= Gem::Version.new(2)
47
+ end
48
+
49
+ def hide_constants
50
+ hide_const('Faraday::Adapter::Patron')
51
+ hide_const('Patron')
52
+ hide_const('Faraday::Adapter::Typhoeus')
53
+ hide_const('Typhoeus')
54
+ end
55
+
56
+ shared_examples 'adapters compatibility' do
57
+ let(:transport_client) { instance_double(Elastic::Transport::Client) }
58
+ let(:adapter) { client.transport.transport.connections.all.first.connection.builder.adapter }
59
+ let(:client) { described_class.new }
60
+
61
+ context 'default ' do
62
+ it 'uses default NetHttp Faraday adapter' do
63
+ hide_constants
64
+ expect(adapter).to eq Faraday::Adapter::NetHttp
65
+ end
66
+ end
67
+
68
+ context 'selecting adapter' do
69
+ it 'uses Typhoeus when specified' do
70
+ allow(Elastic::Transport::Client).to receive(:new).and_return({})
71
+ described_class.new(adapter: :typhoeus)
72
+ expect(Elastic::Transport::Client).to have_received(:new).with(hash_including(adapter: :typhoeus))
73
+ end
74
+ end
75
+ end
@@ -105,32 +105,5 @@ describe Elastic::EnterpriseSearch::WorkplaceSearch::Client do
105
105
  end
106
106
  end
107
107
 
108
- context 'adapters' do
109
- let(:client) { described_class.new }
110
- let(:adapter) { client.transport.transport.connections.all.first.connection.builder.adapter }
111
-
112
- context 'when no adapter is specified' do
113
- it 'uses Faraday NetHttp' do
114
- expect(adapter).to eq Faraday::Adapter::NetHttp
115
- end
116
- end
117
-
118
- context 'when the adapter is patron' do
119
- let(:client) { described_class.new(adapter: :patron) }
120
-
121
- it 'uses Faraday with the adapter' do
122
- expect(adapter).to eq Faraday::Adapter::Patron
123
- end
124
- end
125
-
126
- unless defined?(JRUBY_VERSION)
127
- context 'when the adapter is typhoeus' do
128
- let(:client) { described_class.new(adapter: :patron) }
129
-
130
- it 'uses Faraday with the adapter' do
131
- expect(adapter).to eq Faraday::Adapter::Patron
132
- end
133
- end
134
- end
135
- end
108
+ include_examples 'adapters compatibility'
136
109
  end
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: 8.3.0
4
+ version: 8.5.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-06-28 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: elastic-transport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '8'
19
+ version: '8.1'
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'
26
+ version: '8.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jwt
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -142,6 +142,62 @@ dependencies:
142
142
  - - ">="
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: faraday-httpclient
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ - !ruby/object:Gem::Dependency
160
+ name: faraday-net_http_persistent
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ - !ruby/object:Gem::Dependency
174
+ name: faraday-patron
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ - !ruby/object:Gem::Dependency
188
+ name: faraday-typhoeus
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: '0'
145
201
  description: 'Official API client for Elastic Enterprise Search APIs.
146
202
 
147
203
  '
@@ -165,9 +221,9 @@ files:
165
221
  - ".ci/functions/wait-for-container.sh"
166
222
  - ".ci/jobs/defaults.yml"
167
223
  - ".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
224
  - ".ci/jobs/elastic+enterprise-search-ruby+8.2.yml"
225
+ - ".ci/jobs/elastic+enterprise-search-ruby+8.3.yml"
226
+ - ".ci/jobs/elastic+enterprise-search-ruby+8.4.yml"
171
227
  - ".ci/jobs/elastic+enterprise-search-ruby+main.yml"
172
228
  - ".ci/jobs/elastic+enterprise-search-ruby+pull-request.yml"
173
229
  - ".ci/make.sh"
@@ -210,6 +266,9 @@ files:
210
266
  - docs/guide/release_notes/80.asciidoc
211
267
  - docs/guide/release_notes/81.asciidoc
212
268
  - docs/guide/release_notes/82.asciidoc
269
+ - docs/guide/release_notes/83.asciidoc
270
+ - docs/guide/release_notes/84.asciidoc
271
+ - docs/guide/release_notes/85.asciidoc
213
272
  - docs/guide/release_notes/index.asciidoc
214
273
  - docs/guide/workplace-search-api.asciidoc
215
274
  - elastic-enterprise-search.gemspec