elastic-enterprise-search 7.15.1 → 8.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ci/jobs/elastic+enterprise-search-ruby+7.13.yml +12 -0
- data/.ci/jobs/elastic+enterprise-search-ruby+7.14.yml +12 -0
- data/.ci/jobs/elastic+enterprise-search-ruby+7.15.yml +12 -0
- data/.ci/jobs/elastic+enterprise-search-ruby+7.16.yml +12 -0
- data/.ci/test-matrix.yml +2 -3
- data/.github/workflows/testing.yml +3 -3
- data/.rubocop.yml +1 -1
- data/CHANGELOG +1 -0
- data/CODE_OF_CONDUCT +1 -0
- data/CONTRIBUTING.md +37 -0
- data/NOTICE +2 -0
- data/README.md +25 -29
- data/docs/guide/app-search-api.asciidoc +15 -9
- data/docs/guide/overview.asciidoc +11 -3
- data/docs/guide/release_notes/712.asciidoc +10 -0
- data/docs/guide/release_notes/714.asciidoc +0 -12
- data/docs/guide/release_notes/715.asciidoc +0 -12
- data/docs/guide/release_notes/716.asciidoc +16 -0
- data/docs/guide/release_notes/717.asciidoc +9 -0
- data/docs/guide/release_notes/80.asciidoc +14 -0
- data/docs/guide/release_notes/index.asciidoc +11 -0
- data/elastic-enterprise-search.gemspec +3 -3
- data/lib/elastic/api/response.rb +52 -0
- data/lib/elastic/{workplace-search/api/user_permissions.rb → app-search/api/adaptive_relevance_settings.rb} +10 -15
- data/lib/elastic/app-search/api/adaptive_relevance_suggestions.rb +60 -0
- data/lib/elastic/app-search/api/add_meta_engine_source.rb +4 -5
- data/lib/elastic/app-search/api/api_key.rb +4 -6
- data/lib/elastic/app-search/api/api_logs.rb +8 -15
- data/lib/elastic/app-search/api/count_analytics.rb +5 -5
- data/lib/elastic/app-search/api/crawler_active_crawl_request.rb +4 -7
- data/lib/elastic/app-search/api/crawler_crawl_request.rb +6 -8
- data/lib/elastic/app-search/api/crawler_crawl_schedule.rb +4 -7
- data/lib/elastic/app-search/api/crawler_domain.rb +6 -8
- data/lib/elastic/app-search/api/crawler_domain_validation_result.rb +6 -5
- data/lib/elastic/app-search/api/crawler_metrics.rb +3 -6
- data/lib/elastic/app-search/api/crawler_overview.rb +4 -7
- data/lib/elastic/app-search/api/crawler_process_crawl.rb +6 -8
- data/lib/elastic/app-search/api/crawler_process_crawl_denied_urls.rb +6 -8
- data/lib/elastic/app-search/api/crawler_url_extraction_result.rb +6 -6
- data/lib/elastic/app-search/api/crawler_url_tracing_result.rb +7 -7
- data/lib/elastic/app-search/api/crawler_url_validation_result.rb +7 -7
- data/lib/elastic/app-search/api/crawler_user_agent.rb +3 -6
- data/lib/elastic/app-search/api/create_api_key.rb +10 -10
- data/lib/elastic/app-search/api/create_crawler_crawl_request.rb +9 -5
- data/lib/elastic/app-search/api/create_crawler_crawl_rule.rb +13 -11
- data/lib/elastic/app-search/api/create_crawler_domain.rb +8 -8
- data/lib/elastic/app-search/api/create_crawler_entry_point.rb +10 -8
- data/lib/elastic/app-search/api/create_crawler_process_crawl.rb +6 -6
- data/lib/elastic/app-search/api/create_crawler_sitemap.rb +10 -8
- data/lib/elastic/app-search/api/create_curation.rb +10 -8
- data/lib/elastic/app-search/api/create_engine.rb +8 -7
- data/lib/elastic/app-search/api/create_synonym_set.rb +6 -6
- data/lib/elastic/app-search/api/curation.rb +5 -7
- data/lib/elastic/app-search/api/delete_api_key.rb +4 -6
- data/lib/elastic/app-search/api/delete_crawler_active_crawl_request.rb +4 -7
- data/lib/elastic/app-search/api/delete_crawler_crawl_rule.rb +7 -9
- data/lib/elastic/app-search/api/delete_crawler_crawl_schedule.rb +4 -7
- data/lib/elastic/app-search/api/delete_crawler_domain.rb +6 -8
- data/lib/elastic/app-search/api/delete_crawler_entry_point.rb +7 -9
- data/lib/elastic/app-search/api/delete_crawler_sitemap.rb +7 -9
- data/lib/elastic/app-search/api/delete_curation.rb +5 -7
- data/lib/elastic/app-search/api/delete_documents.rb +4 -5
- data/lib/elastic/app-search/api/delete_engine.rb +3 -6
- data/lib/elastic/app-search/api/delete_meta_engine_source.rb +4 -4
- data/lib/elastic/app-search/api/delete_synonym_set.rb +5 -7
- data/lib/elastic/app-search/api/documents.rb +5 -5
- data/lib/elastic/app-search/api/engine.rb +3 -6
- data/lib/elastic/app-search/api/index_documents.rb +4 -5
- data/lib/elastic/{workplace-search/api/add_user_permissions.rb → app-search/api/list_adaptive_relevance_suggestions.rb} +13 -14
- data/lib/elastic/app-search/api/list_api_keys.rb +2 -5
- data/lib/elastic/app-search/api/list_crawler_crawl_requests.rb +6 -8
- data/lib/elastic/{workplace-search/api/list_permissions.rb → app-search/api/list_crawler_domains.rb} +12 -13
- data/lib/elastic/app-search/api/list_crawler_process_crawls.rb +6 -7
- data/lib/elastic/app-search/api/list_curations.rb +3 -6
- data/lib/elastic/app-search/api/list_documents.rb +3 -6
- data/lib/elastic/app-search/api/list_engines.rb +2 -5
- data/lib/elastic/app-search/api/list_synonym_sets.rb +3 -6
- data/lib/elastic/app-search/api/log_clickthrough.rb +9 -8
- data/lib/elastic/{workplace-search/api/put_user_permissions.rb → app-search/api/put_adaptive_relevance_settings.rb} +13 -14
- data/lib/elastic/app-search/api/put_adaptive_relevance_suggestions.rb +51 -0
- data/lib/elastic/app-search/api/put_api_key.rb +11 -10
- data/lib/elastic/app-search/api/put_crawler_crawl_rule.rb +14 -12
- data/lib/elastic/app-search/api/put_crawler_crawl_schedule.rb +8 -7
- data/lib/elastic/app-search/api/put_crawler_domain.rb +9 -9
- data/lib/elastic/app-search/api/put_crawler_entry_point.rb +11 -9
- data/lib/elastic/app-search/api/put_crawler_sitemap.rb +11 -9
- data/lib/elastic/app-search/api/put_curation.rb +11 -9
- data/lib/elastic/app-search/api/put_documents.rb +4 -4
- data/lib/elastic/app-search/api/put_schema.rb +4 -4
- data/lib/elastic/app-search/api/put_search_settings.rb +6 -6
- data/lib/elastic/app-search/api/put_synonym_set.rb +8 -8
- data/lib/elastic/app-search/api/query_suggestion.rb +5 -5
- data/lib/elastic/app-search/api/refresh_adaptive_relevance_update_process.rb +56 -0
- data/lib/elastic/app-search/api/reset_search_settings.rb +3 -6
- data/lib/elastic/app-search/api/schema.rb +3 -6
- data/lib/elastic/app-search/api/search.rb +6 -5
- data/lib/elastic/app-search/api/search_settings.rb +3 -6
- data/lib/elastic/app-search/api/synonym_set.rb +5 -7
- data/lib/elastic/app-search/api/top_clicks_analytics.rb +5 -5
- data/lib/elastic/app-search/api/top_queries_analytics.rb +4 -4
- data/lib/elastic/enterprise-search/api/health.rb +2 -3
- data/lib/elastic/enterprise-search/api/put_read_only.rb +6 -4
- data/lib/elastic/enterprise-search/api/read_only.rb +2 -3
- data/lib/elastic/enterprise-search/api/stats.rb +2 -3
- data/lib/elastic/enterprise-search/api/version.rb +2 -3
- data/lib/elastic/enterprise-search/client.rb +8 -13
- data/lib/elastic/enterprise-search/request.rb +5 -3
- data/lib/elastic/enterprise-search/version.rb +1 -1
- data/lib/elastic/workplace-search/api/auto_query_refinement_details.rb +3 -4
- data/lib/elastic/workplace-search/api/command_sync_jobs.rb +4 -5
- data/lib/elastic/workplace-search/api/content_source.rb +3 -4
- data/lib/elastic/workplace-search/api/create_analytics_event.rb +16 -12
- data/lib/elastic/workplace-search/api/create_batch_synonym_sets.rb +4 -3
- data/lib/elastic/workplace-search/api/create_content_source.rb +6 -5
- data/lib/elastic/workplace-search/api/create_external_identity.rb +11 -6
- data/lib/elastic/workplace-search/api/current_user.rb +3 -5
- data/lib/elastic/workplace-search/api/delete_content_source.rb +3 -4
- data/lib/elastic/workplace-search/api/delete_documents.rb +4 -4
- data/lib/elastic/workplace-search/api/delete_documents_by_query.rb +4 -3
- data/lib/elastic/workplace-search/api/delete_external_identity.rb +7 -9
- data/lib/elastic/workplace-search/api/delete_synonym_set.rb +3 -5
- data/lib/elastic/workplace-search/api/document.rb +4 -6
- data/lib/elastic/workplace-search/api/external_identity.rb +7 -9
- data/lib/elastic/workplace-search/api/index_documents.rb +3 -4
- data/lib/elastic/workplace-search/api/list_content_sources.rb +2 -3
- data/lib/elastic/workplace-search/api/{remove_user_permissions.rb → list_documents.rb} +12 -12
- data/lib/elastic/workplace-search/api/list_external_identities.rb +3 -4
- data/lib/elastic/workplace-search/api/list_synonym_sets.rb +1 -2
- data/lib/elastic/workplace-search/api/put_content_source.rb +6 -6
- data/lib/elastic/workplace-search/api/put_content_source_icons.rb +6 -6
- data/lib/elastic/workplace-search/api/put_external_identity.rb +11 -10
- data/lib/elastic/workplace-search/api/put_synonym_set.rb +4 -4
- data/lib/elastic/workplace-search/api/put_triggers_blocklist.rb +3 -5
- data/lib/elastic/workplace-search/api/search.rb +13 -13
- data/lib/elastic/workplace-search/api/synonym_set.rb +3 -5
- data/lib/elastic/workplace-search/api/triggers_blocklist.rb +3 -3
- data/spec/app-search/client_spec.rb +29 -0
- data/spec/enterprise-search/client_spec.rb +29 -0
- data/spec/enterprise-search/request_spec.rb +1 -1
- data/spec/integration/app-search/adaptive_relevance_settings_spec.rb +60 -0
- data/spec/integration/app-search/adaptive_relevance_suggestions_spec.rb +54 -0
- data/spec/integration/app-search/api_logs_spec.rb +12 -4
- data/spec/integration/app-search/app_search_helper.rb +2 -2
- data/spec/integration/app-search/count_analytics_spec.rb +3 -2
- data/spec/integration/app-search/crawler_domain_spec.rb +16 -0
- data/spec/integration/app-search/curations_spec.rb +15 -9
- data/spec/integration/app-search/engines_spec.rb +24 -26
- data/spec/integration/app-search/log_clickthrough_spec.rb +1 -1
- data/spec/integration/app-search/meta_engines_spec.rb +5 -5
- data/spec/integration/app-search/search_and_multiple_search_spec.rb +1 -1
- data/spec/integration/workplace-search/content_sources_spec.rb +6 -6
- data/spec/integration/workplace-search/documents_spec.rb +20 -3
- data/spec/integration/workplace-search/external_identities_spec.rb +26 -16
- data/spec/integration/workplace-search/triggers_spec.rb +2 -2
- data/spec/integration/workplace-search/users_spec.rb +0 -6
- data/spec/workplace-search/client_spec.rb +29 -0
- metadata +34 -22
- data/.ci/jobs/elastic+enterprise-search-ruby+7.10.0.beta.1.yml +0 -12
- data/.github/compatibility/Gemfile +0 -23
- data/.github/workflows/compatibility.yml +0 -20
- data/spec/integration/workplace-search/permissions_spec.rb +0 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 934f9963f52322f3ebfe4d938047fda1ab1bde21295bc48e9ff395fd04552b63
|
4
|
+
data.tar.gz: 93ee0ede64ccefd718b271ff50b179c2bf47cb531b5a9a09dd4ac9a06d32b803
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e762a601ada260c8a919af6bb65de7c48142200c585b55bf017e411272a3b653a9bb102ee79573eb3912aee96ea7511be4d51ad031ddb5112ad33e5ce396aca4
|
7
|
+
data.tar.gz: f8c8e04a2b3945a5e93f372beebd466ab4012625d0eea98132c2b2b89295e8bc3b84e99cfb1b0ec919b437b3244b2a7de9dcdca6149887940eb81c190d592514
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
- job:
|
3
|
+
name: elastic+enterprise-search-ruby+7.13
|
4
|
+
display-name: 'elastic / enterprise-search-ruby # 7.13'
|
5
|
+
description: Testing the enterprise-search-ruby 7.13 branch.
|
6
|
+
junit_results: "*-junit.xml"
|
7
|
+
parameters:
|
8
|
+
- string:
|
9
|
+
name: branch_specifier
|
10
|
+
default: refs/heads/7.13
|
11
|
+
description: the Git branch specifier to build (<branchName>, <tagName>,
|
12
|
+
<commitId>, etc.)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
- job:
|
3
|
+
name: elastic+enterprise-search-ruby+7.14
|
4
|
+
display-name: 'elastic / enterprise-search-ruby # 7.14'
|
5
|
+
description: Testing the enterprise-search-ruby 7.14 branch.
|
6
|
+
junit_results: "*-junit.xml"
|
7
|
+
parameters:
|
8
|
+
- string:
|
9
|
+
name: branch_specifier
|
10
|
+
default: refs/heads/7.14
|
11
|
+
description: the Git branch specifier to build (<branchName>, <tagName>,
|
12
|
+
<commitId>, etc.)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
- job:
|
3
|
+
name: elastic+enterprise-search-ruby+7.15
|
4
|
+
display-name: 'elastic / enterprise-search-ruby # 7.15'
|
5
|
+
description: Testing the enterprise-search-ruby 7.15 branch.
|
6
|
+
junit_results: "*-junit.xml"
|
7
|
+
parameters:
|
8
|
+
- string:
|
9
|
+
name: branch_specifier
|
10
|
+
default: refs/heads/7.15
|
11
|
+
description: the Git branch specifier to build (<branchName>, <tagName>,
|
12
|
+
<commitId>, etc.)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
- job:
|
3
|
+
name: elastic+enterprise-search-ruby+7.16
|
4
|
+
display-name: 'elastic / enterprise-search-ruby # 7.16'
|
5
|
+
description: Testing the enterprise-search-ruby 7.16 branch.
|
6
|
+
junit_results: "*-junit.xml"
|
7
|
+
parameters:
|
8
|
+
- string:
|
9
|
+
name: branch_specifier
|
10
|
+
default: refs/heads/7.16
|
11
|
+
description: the Git branch specifier to build (<branchName>, <tagName>,
|
12
|
+
<commitId>, etc.)
|
data/.ci/test-matrix.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
name:
|
1
|
+
name: main
|
2
2
|
on: [push, pull_request]
|
3
3
|
|
4
4
|
jobs:
|
@@ -7,7 +7,7 @@ jobs:
|
|
7
7
|
ENDPOINT: http://localhost:8080
|
8
8
|
strategy:
|
9
9
|
matrix:
|
10
|
-
ruby: [ 2.
|
10
|
+
ruby: [ 2.7, 3.0, 3.1 ]
|
11
11
|
|
12
12
|
runs-on: ubuntu-latest
|
13
13
|
steps:
|
@@ -26,7 +26,7 @@ jobs:
|
|
26
26
|
strategy:
|
27
27
|
fail-fast: false
|
28
28
|
matrix:
|
29
|
-
ruby: [ jruby-9.
|
29
|
+
ruby: [ jruby-9.3 ]
|
30
30
|
runs-on: ubuntu-latest
|
31
31
|
steps:
|
32
32
|
- uses: actions/checkout@v2
|
data/.rubocop.yml
CHANGED
data/CHANGELOG
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
See https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/release_notes.html
|
data/CODE_OF_CONDUCT
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
See: https://www.elastic.co/community/codeofconduct
|
data/CONTRIBUTING.md
CHANGED
@@ -1,5 +1,42 @@
|
|
1
1
|
# Contributing to enterprise-search-ruby
|
2
2
|
|
3
|
+
## Run Stack locally
|
4
|
+
|
5
|
+
A rake task is included to run the Elastic Enterprise Search stack locally via Docker:
|
6
|
+
|
7
|
+
```
|
8
|
+
$ rake stack[7.10.0]
|
9
|
+
```
|
10
|
+
|
11
|
+
This will run Elastic Enterprise Search in http://localhost:3002
|
12
|
+
- Username: `enterprise_search`
|
13
|
+
- Password: `changeme`
|
14
|
+
|
15
|
+
The version of the Elastic Enterprise Search Stack to use should be the same as tags of `https://www.docker.elastic.co/r/enterprise-search`. You can also use SNAPSHOT builds such as `8.0.0-SNAPSHOT`, `7.11-SNAPSHOT`, etc.
|
16
|
+
|
17
|
+
## Running Tests
|
18
|
+
|
19
|
+
Unit tests for the clients:
|
20
|
+
|
21
|
+
```
|
22
|
+
$ rake spec:client
|
23
|
+
```
|
24
|
+
|
25
|
+
Integration tests: you need to have an instance of Enterprise Search running either locally or remotely, and specify the host and credentials in environment variables (see below for a complete dockerized setup). If you're using the included rake task `rake stack[:version]`, you can run the integration tests with the following command:
|
26
|
+
|
27
|
+
```
|
28
|
+
$ ELASTIC_ENTERPRISE_HOST='http://localhost:3002' \
|
29
|
+
ELASTIC_ENTERPRISE_USER='elastic' \
|
30
|
+
ELASTIC_ENTERPRISE_PASSWORD='changeme' \
|
31
|
+
rake spec:integration
|
32
|
+
```
|
33
|
+
|
34
|
+
Run integration tests completely within containers, the way we run them on our CI:
|
35
|
+
```
|
36
|
+
RUNSCRIPTS=enterprise-search STACK_VERSION=7.10.0 ./.ci/run-tests
|
37
|
+
```
|
38
|
+
|
39
|
+
|
3
40
|
## Contributing Code Changes
|
4
41
|
|
5
42
|
1. Please make sure you have signed the [Contributor License
|
data/NOTICE
ADDED
data/README.md
CHANGED
@@ -6,48 +6,44 @@
|
|
6
6
|
|
7
7
|
Official Ruby API client for [Elastic Enterprise Search](https://www.elastic.co/enterprise-search). Use this gem to integrate App Search and Workplace Search into your Ruby code.
|
8
8
|
|
9
|
-
##
|
10
|
-
|
11
|
-
[See the documentation](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/index.html) for compatibility info, configuring, and an API reference.
|
12
|
-
|
13
|
-
## Development
|
14
|
-
|
15
|
-
### Run Stack locally
|
9
|
+
## Installation
|
16
10
|
|
17
|
-
|
11
|
+
Install the `elastic-enterprise-search` gem from [Rubygems](https://rubygems.org/gems/elastic-enterprise-search):
|
18
12
|
|
19
13
|
```
|
20
|
-
$
|
14
|
+
$ gem install elastic-enterprise-search
|
21
15
|
```
|
22
16
|
|
23
|
-
|
24
|
-
- Username: `enterprise_search`
|
25
|
-
- Password: `changeme`
|
17
|
+
Or add it to your project's Gemfile:
|
26
18
|
|
27
|
-
|
19
|
+
```ruby
|
20
|
+
gem 'elastic-enterprise-search', 'VERSION'
|
21
|
+
```
|
28
22
|
|
29
|
-
|
23
|
+
The Enterprise Search client is implemented with [`elastic-transport`](https://github.com/elastic/elastic-transport-ruby/) as the HTTP layer, which uses [Faraday](https://rubygems.org/gems/faraday). Faraday supports several [adapters](https://lostisland.github.io/faraday/adapters/) and will use `Net::HTTP` by default. For optimal performance with the Enterprise Search API, we suggest using an HTTP library which supports persistent ("keep-alive") connections. For the standard Ruby implementation, this could be https://github.com/drbrain/net-http-persistent[Net::HTTP::Persistent], [patron](https://github.com/toland/patron) or [Typhoeus](https://github.com/typhoeus/typhoeus). For JRuby, [Manticore](https://github.com/cheald/manticore) is a great option as well. Require the library for the adapter in your code and then pass in the `:adapter` parameter to the client when you initialize it:
|
30
24
|
|
31
|
-
|
25
|
+
```ruby
|
26
|
+
require 'elastic-enterprise-search'
|
27
|
+
require 'faraday/net_http_persistent'
|
32
28
|
|
29
|
+
client = Elastic::EnterpriseSearch::Client.new(adapter: :net_http_persistent)
|
33
30
|
```
|
34
|
-
|
35
|
-
```
|
31
|
+
If an adapter is not specified, the client will try to auto-detect available libraries and use the best available HTTP client.
|
36
32
|
|
37
|
-
|
33
|
+
## Documentation
|
38
34
|
|
39
|
-
|
40
|
-
$ ELASTIC_ENTERPRISE_HOST='http://localhost:3002' \
|
41
|
-
ELASTIC_ENTERPRISE_USER='elastic' \
|
42
|
-
ELASTIC_ENTERPRISE_PASSWORD='changeme' \
|
43
|
-
rake spec:integration
|
44
|
-
```
|
35
|
+
[See the documentation](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/index.html) for usage, code examples, configuring the client, and an API reference.
|
45
36
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
37
|
+
See code examples of usage for the [Enteprise Search](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/enterprise-search-api.html), [App Search](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/app-search-api.html) and [Workplace Search](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/workplace-search-api.html) APIs.
|
38
|
+
|
39
|
+
## Compatibility
|
40
|
+
|
41
|
+
We follow Ruby’s own maintenance policy and officially support all currently maintained versions per [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/).
|
42
|
+
|
43
|
+
## Development
|
44
|
+
|
45
|
+
See [CONTRIBUTING](https://github.com/elastic/enterprise-search-ruby/blob/main/CONTRIBUTING.md).
|
50
46
|
|
51
47
|
## License
|
52
48
|
|
53
|
-
Apache
|
49
|
+
This software is licensed under the [Apache 2 license](./LICENSE). See [NOTICE](./NOTICE).
|
@@ -123,11 +123,13 @@ client.delete_synonym_set(engine_name, synonym_set_id: id)
|
|
123
123
|
----------------------------
|
124
124
|
# Create a curation
|
125
125
|
client.create_curation(
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
126
|
+
engine_name,
|
127
|
+
body: {
|
128
|
+
queries: ['query1'],
|
129
|
+
promoted: ['doc-id1'],
|
130
|
+
hidden: ['doc-id2']
|
131
|
+
}
|
132
|
+
)
|
131
133
|
|
132
134
|
# Retrieve a curation by id:
|
133
135
|
client.curation(engine_name, curation_id: 'cur-id')
|
@@ -135,10 +137,14 @@ client.curation(engine_name, curation_id: 'cur-id')
|
|
135
137
|
# Update an existing curation:
|
136
138
|
client.put_curation(
|
137
139
|
engine_name,
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
140
|
+
{
|
141
|
+
curation_id: 'cur-id',
|
142
|
+
body: {
|
143
|
+
queries: ['query1'],
|
144
|
+
promoted: ['doc-id2'],
|
145
|
+
hidden: ['doc-id1']
|
146
|
+
}
|
147
|
+
}
|
142
148
|
)
|
143
149
|
|
144
150
|
# List existing curations:
|
@@ -14,11 +14,19 @@ For **Elastic Enterprise Search 7.0** and later, use the major version 7 (`7.x.y
|
|
14
14
|
|
15
15
|
[discrete]
|
16
16
|
=== HTTP Library
|
17
|
-
This library uses https://github.com/elastic/
|
17
|
+
This library uses https://github.com/elastic/elastic-transport-ruby[elastic-transport], the low-level Ruby client for connecting to an Elastic clusters - also used in the official https://github.com/elastic/elasticsearch-ruby[Elasticsearch Ruby Client]. It uses https://rubygems.org/gems/faraday[Faraday], which supports several https://lostisland.github.io/faraday/adapters/[adapters] and will use `Net::HTTP` by default. For optimal performance with the Enterprise Search API, we suggest using an HTTP library which supports persistent ("keep-alive") connections. For the standard Ruby implementation, this could be https://github.com/drbrain/net-http-persistent[Net::HTTP::Persistent], https://github.com/toland/patron[patron] or https://github.com/typhoeus/typhoeus[Typhoeus]. For JRuby, https://github.com/cheald/manticore[Manticore] is a great option as well. Require the library for the adapter in your code and then pass in the `:adapter` parameter to the client when you initialize it:
|
18
18
|
|
19
|
-
|
19
|
+
[source,ruby]
|
20
|
+
---------------------------------------------------
|
21
|
+
require 'elastic-enterprise-search'
|
22
|
+
require 'faraday/net_http_persistent'
|
20
23
|
|
21
|
-
|
24
|
+
client = Elastic::EnterpriseSearch::Client.new(adapter: :net_http_persistent)
|
25
|
+
---------------------------------------------------
|
26
|
+
|
27
|
+
All requests, if successful, will return an `Elastic::Transport::Transport::Response` instance. You can access the response `body`, `headers` and `status`.
|
28
|
+
|
29
|
+
`elastic-transport` defines a https://github.com/elastic/elastic-transport-ruby/blob/main/lib/elastic/transport/transport/errors.rb[number of exception classes] for various client and server errors, as well as unsuccessful HTTP responses, making it possible to rescue specific exceptions with desired granularity. More details https://github.com/elastic/elastic-transport-ruby#exception-handling[here]. You can find the full documentation for `elastic-transport` at https://rubydoc.info/gems/elastic-transport[RubyDoc].
|
22
30
|
|
23
31
|
The clients pass different options to transport, you can check them out https://rubydoc.info/github/elastic/enterprise-search-ruby/Elastic/EnterpriseSearch/Client[on RubyDocs].
|
24
32
|
|
@@ -26,3 +26,13 @@
|
|
26
26
|
|
27
27
|
- Updates source code documentation for `current_page` and `page_size` parameters from type `String` to `Integer`.
|
28
28
|
- In `multi_search`, the body parameter is renamed to `body` from `queries` to avoid repetition and potential confusion.
|
29
|
+
|
30
|
+
[discrete]
|
31
|
+
==== Workplace Search
|
32
|
+
|
33
|
+
- Body parameter renamed to `document_ids` in `delete_documents`:
|
34
|
+
|
35
|
+
[source,rb]
|
36
|
+
----------------------------
|
37
|
+
client.delete_documents(content_source_id, document_ids: ['e68fbc2688f1', 'c535e226aee3'])
|
38
|
+
----------------------------
|
@@ -1,16 +1,4 @@
|
|
1
1
|
[[release_notes_714]]
|
2
|
-
=== 7.14 Release notes
|
3
|
-
|
4
|
-
[discrete]
|
5
|
-
[[release_notes_7141]]
|
6
|
-
=== 7.14.1 Release notes
|
7
|
-
|
8
|
-
==== Dependency fix
|
9
|
-
|
10
|
-
Updates dependency on `elasticsearch-transport` to be more open. At least 7.11 is required, but this way it can be used with different versions of the `elasticsearch` gem (bigger than or equal to `7.11`) in the same project, without a conflict in `elasticsearch-transport`. When instantiating transport, we now check if version is `< 7.14` so we use the right class.
|
11
|
-
|
12
|
-
[discrete]
|
13
|
-
[[release_notes_7140]]
|
14
2
|
=== 7.14.0 Release notes
|
15
3
|
|
16
4
|
[discrete]
|
@@ -1,16 +1,4 @@
|
|
1
1
|
[[release_notes_715]]
|
2
|
-
=== 7.15 Release notes
|
3
|
-
|
4
|
-
[discrete]
|
5
|
-
[[release_notes_7151]]
|
6
|
-
=== 7.15.1 Release notes
|
7
|
-
|
8
|
-
==== Dependency fix
|
9
|
-
|
10
|
-
Updates dependency on `elasticsearch-transport` to be more open. At least 7.11 is required, but this way it can be used with different versions of the `elasticsearch` gem (bigger than or equal to `7.11`) in the same project, without a conflict in `elasticsearch-transport`. When instantiating transport, we now check if version is `< 7.14` so we use the right class.
|
11
|
-
|
12
|
-
[discrete]
|
13
|
-
[[release_notes_7150]]
|
14
2
|
=== 7.15.0 Release notes
|
15
3
|
|
16
4
|
[discrete]
|
@@ -0,0 +1,16 @@
|
|
1
|
+
[[release_notes_716]]
|
2
|
+
=== 7.16 Release notes
|
3
|
+
|
4
|
+
[discrete]
|
5
|
+
==== General
|
6
|
+
|
7
|
+
- Tested with Elastic Enterprise Search API version 7.16.0.
|
8
|
+
|
9
|
+
[discrete]
|
10
|
+
==== App Search
|
11
|
+
|
12
|
+
- Adds Adaptive Relevance APIs. The adaptive relevance API is a **beta** feature. Beta features are subject to change and are not covered by the support SLA of general release (GA) features. Elastic plans to promote this feature to GA in a future release. The adaptive relevance API is not available at all Elastic subscription levels. Refer to the Elastic subscriptions pages for https://www.elastic.co/subscriptions/cloud[Elastic Cloud] and https://www.elastic.co/subscriptions[self-managed] deployments: `adaptive_relevance_settings`, `adaptive_relevance_suggestions`, `list adaptive_relevance_suggestions`, `put_adaptive_relevance_settings`, `put_adaptive_relevance_suggestions`.
|
13
|
+
- Adds `list_crawler_domains` - Returns a list of crawler domains
|
14
|
+
|
15
|
+
==== Workplace Search
|
16
|
+
- Adds `list_documents` - List documents from a custom content source
|
@@ -0,0 +1,14 @@
|
|
1
|
+
[[release_notes_80]]
|
2
|
+
=== 8.0.0.pre Release notes
|
3
|
+
|
4
|
+
[discrete]
|
5
|
+
==== General
|
6
|
+
|
7
|
+
This is a pre-release for the upcoming `8.x` versions of the client.
|
8
|
+
|
9
|
+
- Tested with Elastic Enterprise Search API version 8.0-SNAPSHOT.
|
10
|
+
- Tested with Ruby 2.7, 3.0, 3.1, JRuby 9.3.
|
11
|
+
- Updates request to return an Elastic::API::Response object.
|
12
|
+
|
13
|
+
Full release notes will be released with 8.0.0 GA.
|
14
|
+
|
@@ -2,9 +2,17 @@
|
|
2
2
|
== Release Notes
|
3
3
|
|
4
4
|
|
5
|
+
[discrete]
|
6
|
+
=== 8.x
|
7
|
+
|
8
|
+
* <<release_notes_80, 8.0.0.pre Release Notes>>
|
9
|
+
|
10
|
+
|
5
11
|
[discrete]
|
6
12
|
=== 7.x
|
7
13
|
|
14
|
+
* <<release_notes_717, 7.17.0 Release Notes>>
|
15
|
+
* <<release_notes_716, 7.16.0 Release Notes>>
|
8
16
|
* <<release_notes_715, 7.15.0 Release Notes>>
|
9
17
|
* <<release_notes_714, 7.14.0 Release Notes>>
|
10
18
|
* <<release_notes_713, 7.13.0 Release Notes>>
|
@@ -12,6 +20,9 @@
|
|
12
20
|
* <<release_notes_711, 7.11.0 Release Notes>>
|
13
21
|
* <<release_notes_710, 7.10.0.beta.1 Release Notes>>
|
14
22
|
|
23
|
+
include::80.asciidoc[]
|
24
|
+
include::717.asciidoc[]
|
25
|
+
include::716.asciidoc[]
|
15
26
|
include::715.asciidoc[]
|
16
27
|
include::714.asciidoc[]
|
17
28
|
include::713.asciidoc[]
|
@@ -22,7 +22,7 @@ require 'elastic/enterprise-search/version'
|
|
22
22
|
|
23
23
|
# rubocop:disable Metrics/BlockLength
|
24
24
|
Gem::Specification.new do |s|
|
25
|
-
s.required_ruby_version = '>= 2.
|
25
|
+
s.required_ruby_version = '>= 2.6'
|
26
26
|
s.name = 'elastic-enterprise-search'
|
27
27
|
s.version = Elastic::EnterpriseSearch::VERSION
|
28
28
|
s.authors = ['Fernando Briano']
|
@@ -47,13 +47,13 @@ Gem::Specification.new do |s|
|
|
47
47
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
48
48
|
s.require_paths = ['lib']
|
49
49
|
|
50
|
-
s.add_dependency '
|
50
|
+
s.add_dependency 'elastic-transport', '8.0.0.pre.1'
|
51
51
|
s.add_runtime_dependency 'jwt', '>= 1.5', '< 3.0'
|
52
52
|
s.add_development_dependency 'awesome_print'
|
53
53
|
s.add_development_dependency 'byebug' unless defined?(JRUBY_VERSION)
|
54
54
|
s.add_development_dependency 'rspec', '~> 3.9.0'
|
55
55
|
s.add_development_dependency 'rspec_junit_formatter'
|
56
|
-
s.add_development_dependency 'rubocop', '~> 1
|
56
|
+
s.add_development_dependency 'rubocop', '~> 1'
|
57
57
|
s.add_development_dependency 'vcr', '~> 3.0.3'
|
58
58
|
s.add_development_dependency 'webmock'
|
59
59
|
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
# not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Elastic
|
21
|
+
module API
|
22
|
+
# Elastic client API Response object. Receives an Elastic::Transport::Transport::Response in
|
23
|
+
# the initializer and behaves like a Hash, except when status or headers are called upon it, in
|
24
|
+
# which case it returns the original object's status and headers.
|
25
|
+
# This class is based on Elasticsearch::API::Response in the Elasticsearch client. For future
|
26
|
+
# versions, we'll want this to live in elastic-transport instead.
|
27
|
+
class Response
|
28
|
+
RESPONSE_METHODS = [:status, :body, :headers].freeze
|
29
|
+
|
30
|
+
def initialize(response)
|
31
|
+
@response = response
|
32
|
+
end
|
33
|
+
|
34
|
+
def method_missing(method, *args, &block)
|
35
|
+
if RESPONSE_METHODS.include? method
|
36
|
+
@response.send method.to_sym
|
37
|
+
else
|
38
|
+
@response.body.send(method.to_sym, *args, &block)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def respond_to_missing?(method_name, include_private = false)
|
43
|
+
@response.body.respond_to?(method_name, include_private) ||
|
44
|
+
RESPONSE_METHODS.include?(method_name)
|
45
|
+
end
|
46
|
+
|
47
|
+
def to_s
|
48
|
+
@response.body.to_s
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -19,31 +19,26 @@
|
|
19
19
|
|
20
20
|
module Elastic
|
21
21
|
module EnterpriseSearch
|
22
|
-
module
|
22
|
+
module AppSearch
|
23
23
|
module Actions
|
24
|
-
#
|
25
|
-
#
|
24
|
+
# AdaptiveRelevanceSettings - Retrieve adaptive relevance settings
|
25
|
+
# Retrieve adaptive relevance settings
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [String] :user The username in context (*Required*)
|
27
|
+
# @param [String] engine_name Name of the engine (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
30
29
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
30
|
#
|
32
|
-
# @see https://www.elastic.co/guide/en/
|
31
|
+
# @see https://www.elastic.co/guide/en/app-search/current/adaptive-relevance-api-reference.html#adaptive-relevance-api-get-engine-adaptive-relevance-settings
|
33
32
|
#
|
34
|
-
def
|
35
|
-
raise ArgumentError, "Required parameter '
|
36
|
-
raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user]
|
37
|
-
|
38
|
-
user = arguments[:user]
|
33
|
+
def adaptive_relevance_settings(engine_name, arguments = {})
|
34
|
+
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
39
35
|
|
40
36
|
headers = arguments.delete(:headers) || {}
|
41
|
-
|
42
37
|
request(
|
43
38
|
:get,
|
44
|
-
"api/
|
39
|
+
"api/as/v0/engines/#{engine_name}/adaptive_relevance/settings/",
|
45
40
|
arguments,
|
46
|
-
|
41
|
+
nil,
|
47
42
|
headers
|
48
43
|
)
|
49
44
|
end
|
@@ -0,0 +1,60 @@
|
|
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 [String] engine_name Name of the engine (*Required*)
|
28
|
+
# @param [Hash] arguments 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 [string] :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
|
+
|
40
|
+
unless arguments[:search_suggestion_query]
|
41
|
+
raise ArgumentError,
|
42
|
+
"Required parameter 'search_suggestion_query' missing"
|
43
|
+
end
|
44
|
+
|
45
|
+
search_suggestion_query = arguments.delete(:search_suggestion_query)
|
46
|
+
body = arguments.delete(:body) || {}
|
47
|
+
|
48
|
+
headers = arguments.delete(:headers) || {}
|
49
|
+
request(
|
50
|
+
:post,
|
51
|
+
"api/as/v0/engines/#{engine_name}/adaptive_relevance/suggestions/#{search_suggestion_query}/",
|
52
|
+
arguments,
|
53
|
+
body,
|
54
|
+
headers
|
55
|
+
)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -24,20 +24,19 @@ module Elastic
|
|
24
24
|
# Engines - Add a source engine
|
25
25
|
# Adds a source engine to a given meta engine
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
# @param
|
29
|
-
# @option arguments [Array] :source_engines
|
27
|
+
# @param [String] engine_name Name of the engine (*Required*)
|
28
|
+
# @param [Hash] arguments endpoint arguments
|
29
|
+
# @option arguments [Array<String>] :source_engines
|
30
30
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
31
|
#
|
32
32
|
# @see https://www.elastic.co/guide/en/app-search/current/meta-engines.html#meta-engines-add-source-engines
|
33
33
|
#
|
34
34
|
def add_meta_engine_source(engine_name, arguments = {})
|
35
35
|
raise ArgumentError, "Required parameter 'engine_name' missing" unless engine_name
|
36
|
-
raise ArgumentError, "Required parameter 'source_engines' missing" unless arguments[:source_engines]
|
37
36
|
|
38
37
|
source_engines = arguments.delete(:source_engines) || {}
|
39
|
-
headers = arguments.delete(:headers) || {}
|
40
38
|
|
39
|
+
headers = arguments.delete(:headers) || {}
|
41
40
|
request(
|
42
41
|
:post,
|
43
42
|
"api/as/v1/engines/#{engine_name}/source_engines/",
|