elastic-enterprise-search 8.4.0 → 8.6.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.
- checksums.yaml +4 -4
- data/.buildkite/Dockerfile +13 -0
- data/.buildkite/certs/README.md +50 -0
- data/.buildkite/certs/ca.crt +20 -0
- data/.buildkite/certs/ca.key +27 -0
- data/.buildkite/certs/testnode.crt +21 -0
- data/.buildkite/certs/testnode.key +27 -0
- data/.buildkite/certs/testnode_no_san.crt +19 -0
- data/.buildkite/certs/testnode_no_san.key +27 -0
- data/.buildkite/functions/cleanup.sh +67 -0
- data/.buildkite/functions/imports.sh +60 -0
- data/.buildkite/functions/wait-for-container.sh +36 -0
- data/.buildkite/log-results.sh +15 -0
- data/.buildkite/pipeline.yml +25 -0
- data/.buildkite/run-client.sh +35 -0
- data/.buildkite/run-elasticsearch.sh +150 -0
- data/.buildkite/run-enterprise-search.sh +72 -0
- data/.buildkite/run-tests.sh +24 -0
- data/.ci/.env +9 -0
- data/.ci/docker-compose.yml +166 -0
- data/.ci/jobs/{elastic+enterprise-search-ruby+8.0.yml → elastic+enterprise-search-ruby+8.4.yml} +4 -4
- data/.ci/jobs/{elastic+enterprise-search-ruby+8.1.yml → elastic+enterprise-search-ruby+8.5.yml} +4 -4
- data/.ci/run-kibana.sh +22 -0
- data/.ci/run-stack.sh +1 -0
- data/.ci/test-matrix.yml +1 -1
- data/.github/workflows/rubocop.yml +2 -2
- data/.github/workflows/testing.yml +3 -1
- data/.gitignore +2 -1
- data/README.md +1 -1
- data/docs/guide/release_notes/717.asciidoc +12 -0
- data/docs/guide/release_notes/85.asciidoc +40 -0
- data/docs/guide/release_notes/86.asciidoc +9 -0
- data/docs/guide/release_notes/index.asciidoc +4 -0
- data/elastic-enterprise-search.gemspec +7 -2
- data/lib/elastic/app-search/api/put_search_settings.rb +1 -0
- data/lib/elastic/app-search/api/search_es_search.rb +2 -1
- data/lib/elastic/app-search/api/search_explain.rb +1 -1
- data/lib/elastic/enterprise-search/version.rb +1 -1
- data/spec/app-search/client_spec.rb +1 -28
- data/spec/enterprise-search/client_spec.rb +2 -29
- data/spec/spec_helper.rb +38 -0
- data/spec/workplace-search/client_spec.rb +1 -28
- metadata +89 -11
- data/.ci/jobs/elastic+enterprise-search-ruby+8.2.yml +0 -12
@@ -0,0 +1,72 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
#
|
3
|
+
# Launch one App Search node via the Docker image,
|
4
|
+
# to form a cluster suitable for running the REST API tests.
|
5
|
+
#
|
6
|
+
# Export the STACK_VERSION variable, eg. '8.0.0-SNAPSHOT'.
|
7
|
+
|
8
|
+
# Version 1.1.0
|
9
|
+
# - Initial version of the run-app-search.sh script
|
10
|
+
# - Refactored .ci version
|
11
|
+
|
12
|
+
script_path=$(dirname $(realpath -s $0))
|
13
|
+
source $script_path/functions/imports.sh
|
14
|
+
set -euo pipefail
|
15
|
+
|
16
|
+
CONTAINER_NAME=${CONTAINER_NAME-enterprise-search}
|
17
|
+
APP_SEARCH_SECRET_SESSION_KEY=${APP_SEARCH_SECRET_SESSION_KEY-int_test_secret}
|
18
|
+
|
19
|
+
echo -e "\033[34;1mINFO:\033[0m Take down node if called twice with the same arguments (DETACH=true) or on seperate terminals \033[0m"
|
20
|
+
cleanup_node $CONTAINER_NAME
|
21
|
+
|
22
|
+
http_port=3002
|
23
|
+
url=http://127.0.0.1:${http_port}
|
24
|
+
|
25
|
+
# Pull the container, retry on failures up to 5 times with
|
26
|
+
# short delays between each attempt. Fixes most transient network errors.
|
27
|
+
docker_pull_attempts=0
|
28
|
+
until [ "$docker_pull_attempts" -ge 5 ]
|
29
|
+
do
|
30
|
+
docker pull docker.elastic.co/enterprise-search/enterprise-search:"$STACK_VERSION" && break
|
31
|
+
docker_pull_attempts=$((docker_pull_attempts+1))
|
32
|
+
echo "Failed to pull image, retrying in 10 seconds (retry $docker_pull_attempts/5)..."
|
33
|
+
sleep 10
|
34
|
+
done
|
35
|
+
|
36
|
+
echo -e "\033[34;1mINFO:\033[0m Starting container $CONTAINER_NAME \033[0m"
|
37
|
+
set -x
|
38
|
+
docker run \
|
39
|
+
--name "$CONTAINER_NAME" \
|
40
|
+
--network "$network_name" \
|
41
|
+
--env "elasticsearch.host=$elasticsearch_url" \
|
42
|
+
--env "elasticsearch.username=elastic" \
|
43
|
+
--env "elasticsearch.password=$elastic_password" \
|
44
|
+
--env "ENT_SEARCH_DEFAULT_PASSWORD=$elastic_password" \
|
45
|
+
--env "secret_management.encryption_keys=[$APP_SEARCH_SECRET_SESSION_KEY]" \
|
46
|
+
--env "enterprise_search.listen_port=$http_port" \
|
47
|
+
--env "log_level=info" \
|
48
|
+
--env "hide_version_info=false" \
|
49
|
+
--env "worker.threads=2" \
|
50
|
+
--env "allow_es_settings_modification=true" \
|
51
|
+
--env "JAVA_OPTS=-Xms1g -Xmx2g" \
|
52
|
+
--env "elasticsearch.ssl.enabled=true" \
|
53
|
+
--env "elasticsearch.ssl.verify=true" \
|
54
|
+
--env "elasticsearch.ssl.certificate=/usr/share/app-search/config/certs/testnode.crt" \
|
55
|
+
--env "elasticsearch.ssl.certificate_authority=/usr/share/app-search/config/certs/ca.crt" \
|
56
|
+
--env "elasticsearch.ssl.key=/usr/share/app-search/config/certs/testnode.key" \
|
57
|
+
--env "ELASTICSEARCH_SEARCH_API=true" \
|
58
|
+
--volume $ssl_cert:/usr/share/app-search/config/certs/testnode.crt \
|
59
|
+
--volume $ssl_key:/usr/share/app-search/config/certs/testnode.key \
|
60
|
+
--volume $ssl_ca:/usr/share/app-search/config/certs/ca.crt \
|
61
|
+
--publish "$http_port":3002 \
|
62
|
+
--detach="$DETACH" \
|
63
|
+
--health-cmd="curl --insecure --fail ${url} || exit 1" \
|
64
|
+
--health-interval=30s \
|
65
|
+
--health-retries=50 \
|
66
|
+
--health-timeout=10s \
|
67
|
+
--rm \
|
68
|
+
docker.elastic.co/enterprise-search/enterprise-search:"$STACK_VERSION";
|
69
|
+
|
70
|
+
if wait_for_container "$CONTAINER_NAME" "$network_name"; then
|
71
|
+
echo -e "\033[32;1mSUCCESS:\033[0m Running on: ${url}\033[0m"
|
72
|
+
fi
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
#
|
3
|
+
# Script to run Enterprise Search container and Enterprise Search client integration tests on Buildkite
|
4
|
+
#
|
5
|
+
# Version 0.1
|
6
|
+
#
|
7
|
+
export TEST_SUITE=platinum
|
8
|
+
export CONTAINER_NAME=enterprise-search
|
9
|
+
|
10
|
+
script_path=$(dirname $(realpath -s $0))
|
11
|
+
source $script_path/functions/imports.sh
|
12
|
+
set -euo pipefail
|
13
|
+
|
14
|
+
echo "--- Create the elastic network"
|
15
|
+
docker network create elastic
|
16
|
+
|
17
|
+
echo "--- :elasticsearch: Starting Elasticsearch"
|
18
|
+
DETACH=true bash $script_path/run-elasticsearch.sh
|
19
|
+
|
20
|
+
echo "--- :elastic-enterprise-search: Starting Enterprise Search"
|
21
|
+
DETACH=true bash $script_path/run-enterprise-search.sh
|
22
|
+
|
23
|
+
echo "+++ :ruby: Run Client"
|
24
|
+
bash $script_path/run-client.sh
|
data/.ci/.env
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
|
2
|
+
version: "2.2"
|
3
|
+
|
4
|
+
services:
|
5
|
+
setup:
|
6
|
+
image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION}
|
7
|
+
volumes:
|
8
|
+
- certs:/usr/share/elasticsearch/config/certs
|
9
|
+
user: "0"
|
10
|
+
command: >
|
11
|
+
bash -c '
|
12
|
+
if [ x${ELASTIC_PASSWORD} == x ]; then
|
13
|
+
echo "Set the ELASTIC_PASSWORD environment variable in the .env file";
|
14
|
+
exit 1;
|
15
|
+
elif [ x${KIBANA_PASSWORD} == x ]; then
|
16
|
+
echo "Set the KIBANA_PASSWORD environment variable in the .env file";
|
17
|
+
exit 1;
|
18
|
+
fi;
|
19
|
+
if [ ! -f certs/ca.zip ]; then
|
20
|
+
echo "Creating CA";
|
21
|
+
bin/elasticsearch-certutil ca --silent --pem -out config/certs/ca.zip;
|
22
|
+
unzip config/certs/ca.zip -d config/certs;
|
23
|
+
fi;
|
24
|
+
if [ ! -f certs/certs.zip ]; then
|
25
|
+
echo "Creating certs";
|
26
|
+
echo -ne \
|
27
|
+
"instances:\n"\
|
28
|
+
" - name: es01\n"\
|
29
|
+
" dns:\n"\
|
30
|
+
" - es01\n"\
|
31
|
+
" - localhost\n"\
|
32
|
+
" ip:\n"\
|
33
|
+
" - 127.0.0.1\n"\
|
34
|
+
> config/certs/instances.yml;
|
35
|
+
bin/elasticsearch-certutil cert --silent --pem -out config/certs/certs.zip --in config/certs/instances.yml --ca-cert config/certs/ca/ca.crt --ca-key config/certs/ca/ca.key;
|
36
|
+
unzip config/certs/certs.zip -d config/certs;
|
37
|
+
fi;
|
38
|
+
echo "Setting file permissions"
|
39
|
+
chown -R root:root config/certs;
|
40
|
+
find . -type d -exec chmod 750 \{\} \;;
|
41
|
+
find . -type f -exec chmod 640 \{\} \;;
|
42
|
+
echo "Waiting for Elasticsearch availability";
|
43
|
+
until curl -s --cacert config/certs/ca/ca.crt https://es01:9200 | grep -q "missing authentication credentials"; do sleep 30; done;
|
44
|
+
echo "Setting kibana_system password";
|
45
|
+
until curl -s -X POST --cacert config/certs/ca/ca.crt -u elastic:${ELASTIC_PASSWORD} -H "Content-Type: application/json" https://es01:9200/_security/user/kibana_system/_password -d "{\"password\":\"${KIBANA_PASSWORD}\"}" | grep -q "^{}"; do sleep 10; done;
|
46
|
+
echo "All done!";
|
47
|
+
'
|
48
|
+
healthcheck:
|
49
|
+
test: ["CMD-SHELL", "[ -f config/certs/es01/es01.crt ]"]
|
50
|
+
interval: 1s
|
51
|
+
timeout: 5s
|
52
|
+
retries: 120
|
53
|
+
|
54
|
+
es01:
|
55
|
+
depends_on:
|
56
|
+
setup:
|
57
|
+
condition: service_healthy
|
58
|
+
image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION}
|
59
|
+
volumes:
|
60
|
+
- certs:/usr/share/elasticsearch/config/certs
|
61
|
+
- esdata01:/usr/share/elasticsearch/data
|
62
|
+
ports:
|
63
|
+
- ${ES_PORT}:9200
|
64
|
+
environment:
|
65
|
+
- node.name=es01
|
66
|
+
- cluster.name=${CLUSTER_NAME}
|
67
|
+
- cluster.initial_master_nodes=es01
|
68
|
+
- ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
|
69
|
+
- bootstrap.memory_lock=true
|
70
|
+
- xpack.security.enabled=true
|
71
|
+
- xpack.security.http.ssl.enabled=true
|
72
|
+
- xpack.security.http.ssl.key=certs/es01/es01.key
|
73
|
+
- xpack.security.http.ssl.certificate=certs/es01/es01.crt
|
74
|
+
- xpack.security.http.ssl.certificate_authorities=certs/ca/ca.crt
|
75
|
+
- xpack.security.http.ssl.verification_mode=certificate
|
76
|
+
- xpack.security.transport.ssl.enabled=true
|
77
|
+
- xpack.security.transport.ssl.key=certs/es01/es01.key
|
78
|
+
- xpack.security.transport.ssl.certificate=certs/es01/es01.crt
|
79
|
+
- xpack.security.transport.ssl.certificate_authorities=certs/ca/ca.crt
|
80
|
+
- xpack.security.transport.ssl.verification_mode=certificate
|
81
|
+
- xpack.license.self_generated.type=trial
|
82
|
+
mem_limit: ${MEM_LIMIT}
|
83
|
+
ulimits:
|
84
|
+
memlock:
|
85
|
+
soft: -1
|
86
|
+
hard: -1
|
87
|
+
healthcheck:
|
88
|
+
test:
|
89
|
+
[
|
90
|
+
"CMD-SHELL",
|
91
|
+
"curl -s --cacert config/certs/ca/ca.crt https://localhost:9200 | grep -q 'missing authentication credentials'",
|
92
|
+
]
|
93
|
+
interval: 10s
|
94
|
+
timeout: 10s
|
95
|
+
retries: 120
|
96
|
+
|
97
|
+
kibana:
|
98
|
+
depends_on:
|
99
|
+
es01:
|
100
|
+
condition: service_healthy
|
101
|
+
image: docker.elastic.co/kibana/kibana:${STACK_VERSION}
|
102
|
+
volumes:
|
103
|
+
- certs:/usr/share/kibana/config/certs
|
104
|
+
- kibanadata:/usr/share/kibana/data
|
105
|
+
ports:
|
106
|
+
- ${KIBANA_PORT}:5601
|
107
|
+
environment:
|
108
|
+
- SERVERNAME=kibana
|
109
|
+
- ELASTICSEARCH_HOSTS=https://es01:9200
|
110
|
+
- ELASTICSEARCH_USERNAME=kibana_system
|
111
|
+
- ELASTICSEARCH_PASSWORD=${KIBANA_PASSWORD}
|
112
|
+
- ELASTICSEARCH_SSL_CERTIFICATEAUTHORITIES=config/certs/ca/ca.crt
|
113
|
+
- ENTERPRISESEARCH_HOST=http://enterprisesearch:${ENTERPRISE_SEARCH_PORT}
|
114
|
+
mem_limit: ${MEM_LIMIT}
|
115
|
+
healthcheck:
|
116
|
+
test:
|
117
|
+
[
|
118
|
+
"CMD-SHELL",
|
119
|
+
"curl -s -I http://localhost:5601 | grep -q 'HTTP/1.1 302 Found'",
|
120
|
+
]
|
121
|
+
interval: 10s
|
122
|
+
timeout: 10s
|
123
|
+
retries: 120
|
124
|
+
|
125
|
+
enterprisesearch:
|
126
|
+
depends_on:
|
127
|
+
es01:
|
128
|
+
condition: service_healthy
|
129
|
+
kibana:
|
130
|
+
condition: service_healthy
|
131
|
+
image: docker.elastic.co/enterprise-search/enterprise-search:${STACK_VERSION}
|
132
|
+
volumes:
|
133
|
+
- certs:/usr/share/enterprise-search/config/certs
|
134
|
+
- enterprisesearchdata:/usr/share/enterprise-search/config
|
135
|
+
ports:
|
136
|
+
- ${ENTERPRISE_SEARCH_PORT}:3002
|
137
|
+
environment:
|
138
|
+
- SERVERNAME=enterprisesearch
|
139
|
+
- secret_management.encryption_keys=[${ENCRYPTION_KEYS}]
|
140
|
+
- allow_es_settings_modification=true
|
141
|
+
- elasticsearch.host=https://es01:9200
|
142
|
+
- elasticsearch.username=elastic
|
143
|
+
- elasticsearch.password=${ELASTIC_PASSWORD}
|
144
|
+
- elasticsearch.ssl.enabled=true
|
145
|
+
- elasticsearch.ssl.certificate_authority=/usr/share/enterprise-search/config/certs/ca/ca.crt
|
146
|
+
- kibana.external_url=http://kibana:5601
|
147
|
+
mem_limit: ${MEM_LIMIT}
|
148
|
+
healthcheck:
|
149
|
+
test:
|
150
|
+
[
|
151
|
+
"CMD-SHELL",
|
152
|
+
"curl -s -I http://localhost:3002 | grep -q 'HTTP/1.1 302 Found'",
|
153
|
+
]
|
154
|
+
interval: 10s
|
155
|
+
timeout: 10s
|
156
|
+
retries: 120
|
157
|
+
|
158
|
+
volumes:
|
159
|
+
certs:
|
160
|
+
driver: local
|
161
|
+
enterprisesearchdata:
|
162
|
+
driver: local
|
163
|
+
esdata01:
|
164
|
+
driver: local
|
165
|
+
kibanadata:
|
166
|
+
driver: local
|
data/.ci/jobs/{elastic+enterprise-search-ruby+8.0.yml → elastic+enterprise-search-ruby+8.4.yml}
RENAMED
@@ -1,12 +1,12 @@
|
|
1
1
|
---
|
2
2
|
- job:
|
3
|
-
name: elastic+enterprise-search-ruby+8.
|
4
|
-
display-name: 'elastic / enterprise-search-ruby # 8.
|
5
|
-
description: Testing the enterprise-search-ruby 8.
|
3
|
+
name: elastic+enterprise-search-ruby+8.4
|
4
|
+
display-name: 'elastic / enterprise-search-ruby # 8.4'
|
5
|
+
description: Testing the enterprise-search-ruby 8.4 branch.
|
6
6
|
junit_results: "*-junit.xml"
|
7
7
|
parameters:
|
8
8
|
- string:
|
9
9
|
name: branch_specifier
|
10
|
-
default: refs/heads/8.
|
10
|
+
default: refs/heads/8.4
|
11
11
|
description: the Git branch specifier to build (<branchName>, <tagName>,
|
12
12
|
<commitId>, etc.)
|
data/.ci/jobs/{elastic+enterprise-search-ruby+8.1.yml → elastic+enterprise-search-ruby+8.5.yml}
RENAMED
@@ -1,12 +1,12 @@
|
|
1
1
|
---
|
2
2
|
- job:
|
3
|
-
name: elastic+enterprise-search-ruby+8.
|
4
|
-
display-name: 'elastic / enterprise-search-ruby # 8.
|
5
|
-
description: Testing the enterprise-search-ruby 8.
|
3
|
+
name: elastic+enterprise-search-ruby+8.5
|
4
|
+
display-name: 'elastic / enterprise-search-ruby # 8.5'
|
5
|
+
description: Testing the enterprise-search-ruby 8.5 branch.
|
6
6
|
junit_results: "*-junit.xml"
|
7
7
|
parameters:
|
8
8
|
- string:
|
9
9
|
name: branch_specifier
|
10
|
-
default: refs/heads/8.
|
10
|
+
default: refs/heads/8.5
|
11
11
|
description: the Git branch specifier to build (<branchName>, <tagName>,
|
12
12
|
<commitId>, etc.)
|
data/.ci/run-kibana.sh
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
script_path=$(dirname $(realpath -s $0))
|
4
|
+
source $script_path/functions/imports.sh
|
5
|
+
set -euo pipefail
|
6
|
+
|
7
|
+
docker run \
|
8
|
+
--name "kibana" \
|
9
|
+
--network "$network_name" \
|
10
|
+
--publish "5601:5601" \
|
11
|
+
--interactive \
|
12
|
+
--tty \
|
13
|
+
--rm \
|
14
|
+
--env "ENTERPRISESEARCH_HOST=http://localhost:3002" \
|
15
|
+
"docker.elastic.co/kibana/kibana:${STACK_VERSION}"
|
16
|
+
|
17
|
+
# --volume $ssl_ca:/usr/share/elasticsearch/config/certs/ca.crt \
|
18
|
+
|
19
|
+
# --env "ELASTICSEARCH_HOSTS=${elasticsearch_url}" \
|
20
|
+
# --env "ELASTICSEARCH_USERNAME=enterprise_search" \
|
21
|
+
# --env "ELASTICSEARCH_PASSWORD=${elastic_password}" \
|
22
|
+
# --env "ELASTICSEARCH_SSL_CERTIFICATEAUTHORITIES=${ssl_ca}" \
|
data/.ci/run-stack.sh
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
STACK_VERSION=${STACK_VERSION} docker-compose up --remove-orphans
|
data/.ci/test-matrix.yml
CHANGED
@@ -16,6 +16,8 @@ jobs:
|
|
16
16
|
ruby-version: ${{ matrix.ruby }}
|
17
17
|
- name: Build and test with Rake
|
18
18
|
run: |
|
19
|
+
sudo apt-get update
|
20
|
+
sudo apt-get install libcurl4-openssl-dev
|
19
21
|
ruby -v
|
20
22
|
bundle install
|
21
23
|
bundle exec rake spec:client
|
@@ -25,7 +27,7 @@ jobs:
|
|
25
27
|
strategy:
|
26
28
|
fail-fast: false
|
27
29
|
matrix:
|
28
|
-
ruby: [ jruby-9.3 ]
|
30
|
+
ruby: [ jruby-9.3, jruby-9.4 ]
|
29
31
|
runs-on: ubuntu-latest
|
30
32
|
steps:
|
31
33
|
- uses: actions/checkout@v2
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -20,7 +20,7 @@ Or add it to your project's Gemfile:
|
|
20
20
|
gem 'elastic-enterprise-search', 'VERSION'
|
21
21
|
```
|
22
22
|
|
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
|
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 [Net::HTTP::Persistent](https://github.com/drbrain/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:
|
24
24
|
|
25
25
|
```ruby
|
26
26
|
require 'elastic-enterprise-search'
|
@@ -1,6 +1,18 @@
|
|
1
1
|
[[release_notes_717]]
|
2
2
|
=== 7.17 Release notes
|
3
3
|
|
4
|
+
[discrete]
|
5
|
+
[[release_notes_7171]]
|
6
|
+
=== 7.17.1 Release notes
|
7
|
+
|
8
|
+
- Updates in Documentation: CHANGELOG, CODE_OF_CONDUCT, CONTRIBUTING, NOTICE, README
|
9
|
+
- Adds the option to specify an adapter for Faraday when initializing a client. See https://github.com/elastic/enterprise-search-ruby/blob/main/README.md#elastic-enterprise-search-client[README]
|
10
|
+
- Fixes typo in meta data for CLIENT_NAME.
|
11
|
+
|
12
|
+
[discrete]
|
13
|
+
[[release_notes_7170]]
|
14
|
+
=== 7.17.0 Release notes
|
15
|
+
|
4
16
|
[discrete]
|
5
17
|
==== General
|
6
18
|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
[[release_notes_85]]
|
2
|
+
=== 8.5 Release notes
|
3
|
+
|
4
|
+
[discrete]
|
5
|
+
[[release_notes_850]]
|
6
|
+
=== 8.5.0 Release notes
|
7
|
+
|
8
|
+
==== Client
|
9
|
+
- Updates dependency on `elastic-transport`. With the latest release of `elastic-transport` - `v8.1.0` - this gem now supports Faraday v2. When you upgrade your gems, `8.1.0` will be installed. This supports both Faraday v1 and Faraday v2. The main change on dependencies when using Faraday v2 is all adapters, except for the default `net_http` one, have been moved out of Faraday into separate gems. This means if you're not using the default adapter and you migrate to Faraday v2, you'll need to add the adapter gems to your Gemfile.
|
10
|
+
|
11
|
+
These are the gems required for the different adapters with Faraday 2, instead of the libraries on which they were based:
|
12
|
+
|
13
|
+
[source,rb]
|
14
|
+
----------------------------
|
15
|
+
# HTTPCLient
|
16
|
+
gem 'faraday-httpclient'
|
17
|
+
# NetHTTPPersistent
|
18
|
+
gem 'faraday-net_http_persistent'
|
19
|
+
# Patron
|
20
|
+
gem 'faraday-patron'
|
21
|
+
# Typhoeus
|
22
|
+
gem 'faraday-typhoeus'
|
23
|
+
----------------------------
|
24
|
+
|
25
|
+
Things should work fine if you migrate to Faraday 2 as long as you include the adapter (unless you're using the default one `net-http`), but worst case scenario, you can always lock the version of Faraday in your project to 1.x:
|
26
|
+
`gem 'faraday', '~> 1'`
|
27
|
+
|
28
|
+
*Troubleshooting*
|
29
|
+
|
30
|
+
If you see a message like:
|
31
|
+
`:adapter is not registered on Faraday::Adapter (Faraday::Error)`
|
32
|
+
Then you probably need to include the adapter library in your gemfile and require it.
|
33
|
+
|
34
|
+
Please https://github.com/elastic/enterprise-search-ruby/issues[submit an issue] if you encounter any problems.
|
35
|
+
|
36
|
+
[discrete]
|
37
|
+
==== App Search
|
38
|
+
|
39
|
+
- Adds `precision_enabled` (Boolean) to `put_search_settings`. See https://www.elastic.co/guide/en/app-search/current/search-settings.html#search-settings-update[here] for more information.
|
40
|
+
- `search_es_search` and `search_explain` changed the path to `api/as/v1` instead of `v0` and are now GA with version `8.5` of the stack.
|
@@ -0,0 +1,9 @@
|
|
1
|
+
[[release_notes_86]]
|
2
|
+
=== 8.6 Release notes
|
3
|
+
|
4
|
+
[discrete]
|
5
|
+
[[release_notes_860]]
|
6
|
+
=== 8.6.0 Release notes
|
7
|
+
|
8
|
+
- Tested versions of Ruby for 8.6.0: Ruby (MRI) 2.7, 3.0 and 3.1, JRuby 9.3 and JRuby 9.4.
|
9
|
+
- Updated for compatibility with Elastic Enterprise Search 8.6's API.
|
@@ -4,6 +4,8 @@
|
|
4
4
|
[discrete]
|
5
5
|
=== 8.x
|
6
6
|
|
7
|
+
* <<release_notes_86, 8.6.0 Release Notes>>
|
8
|
+
* <<release_notes_85, 8.5.0 Release Notes>>
|
7
9
|
* <<release_notes_84, 8.4.0 Release Notes>>
|
8
10
|
* <<release_notes_83, 8.3.0 Release Notes>>
|
9
11
|
* <<release_notes_82, 8.2.0 Release Notes>>
|
@@ -22,6 +24,8 @@
|
|
22
24
|
* <<release_notes_711, 7.11.0 Release Notes>>
|
23
25
|
* <<release_notes_710, 7.10.0.beta.1 Release Notes>>
|
24
26
|
|
27
|
+
include::86.asciidoc[]
|
28
|
+
include::85.asciidoc[]
|
25
29
|
include::84.asciidoc[]
|
26
30
|
include::83.asciidoc[]
|
27
31
|
include::82.asciidoc[]
|
@@ -47,14 +47,19 @@ 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 'elastic-transport', '~> 8'
|
50
|
+
s.add_dependency 'elastic-transport', '~> 8.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
56
|
s.add_development_dependency 'rubocop', '~> 1'
|
57
|
-
s.add_development_dependency 'vcr'
|
57
|
+
s.add_development_dependency 'vcr'
|
58
58
|
s.add_development_dependency 'webmock'
|
59
|
+
# Adapters
|
60
|
+
s.add_development_dependency 'faraday-httpclient'
|
61
|
+
s.add_development_dependency 'faraday-net_http_persistent'
|
62
|
+
s.add_development_dependency 'faraday-patron' unless defined? JRUBY_VERSION
|
63
|
+
s.add_development_dependency 'faraday-typhoeus'
|
59
64
|
end
|
60
65
|
# rubocop:enable Metrics/BlockLength
|
@@ -31,6 +31,7 @@ module Elastic
|
|
31
31
|
# @option body :search_fields
|
32
32
|
# @option body :result_fields
|
33
33
|
# @option body [integer] :precision
|
34
|
+
# @option body [boolean] :precision_enabled
|
34
35
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
35
36
|
#
|
36
37
|
# @see https://www.elastic.co/guide/en/app-search/current/search-settings.html#search-settings-update
|
@@ -27,6 +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 Query parameters to be passed to Elasticsearch _search API
|
30
|
+
# @option arguments [Object] :es_search_query_params Query parameters to be passed to Elasticsearch _search API
|
30
31
|
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
32
|
# @option headers [String] :X-Enterprise-Search-Analytics The search query associated with this request when recording search analytics
|
32
33
|
# @option headers [String] :X-Enterprise-Search-Analytics-Tags Analytics tags to be applied with this search request
|
@@ -40,7 +41,7 @@ module Elastic
|
|
40
41
|
headers = arguments.delete(:headers) || {}
|
41
42
|
request(
|
42
43
|
:post,
|
43
|
-
"api/as/
|
44
|
+
"api/as/v1/engines/#{engine_name}/elasticsearch/_search/",
|
44
45
|
arguments,
|
45
46
|
body,
|
46
47
|
headers
|
@@ -86,32 +86,5 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
-
|
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
|
@@ -96,7 +96,7 @@ describe Elastic::EnterpriseSearch::Client do
|
|
96
96
|
context 'meta-header' do
|
97
97
|
let(:transport) { Elastic::EnterpriseSearch::Client.new.instance_variable_get('@transport') }
|
98
98
|
let(:subject) { transport.transport.connections.first.connection.headers }
|
99
|
-
let(:regexp) { /^[a-z]{1,}=[a-z0-9
|
99
|
+
let(:regexp) { /^[a-z]{1,}=[a-z0-9.-]{1,}(?:,[a-z]{1,}=[a-z0-9._-]+)*$/ }
|
100
100
|
|
101
101
|
it 'sends the correct meta header to transport' do
|
102
102
|
expect(subject['x-elastic-client-meta']).to match(regexp)
|
@@ -104,32 +104,5 @@ describe Elastic::EnterpriseSearch::Client do
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
-
|
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
|