search_flip 3.8.0 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +4 -0
- data/CHANGELOG.md +14 -1
- data/Gemfile +1 -1
- data/README.md +10 -0
- data/lib/search_flip/connection.rb +2 -2
- data/lib/search_flip/version.rb +1 -1
- data/spec/search_flip/connection_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84f5374ca017b59ee706e4e6e06c9739c18a83395ded6df0628b234d0e129e39
|
4
|
+
data.tar.gz: 1f6e1dd1a76f69b8cb552387add7d1dfe2b367739c38a7b9260db0c9954b8e26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 283b816aa7602cb4ffb1c981421e7fb13353158f40de052daec3c6c6700b42ff2b19eeb6accb22b8dcc29cf4589caf8c4a01edd827bc055eb97e16c6ed3ba972
|
7
|
+
data.tar.gz: a63de18588ef4b93c38eb7b4bfb91135f73e027f21371ff46c053dfbadb207661008aa5b31d05ac6e62298539e73cdf5c8421bb6aff93f2369f2712724bcd7f8
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,20 @@
|
|
1
1
|
|
2
2
|
# CHANGELOG
|
3
3
|
|
4
|
-
## v3.
|
4
|
+
## v3.9.0
|
5
|
+
|
6
|
+
* Allow to configure the elasticsearch version no matter which elasticsearch
|
7
|
+
version is actually in use. The version information is needed to support
|
8
|
+
version dependent features. Please note that manually configuring the version
|
9
|
+
is usually not need as the version by default is determined by sending one
|
10
|
+
request to elasticsearch.
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
SearchFlip::Config[:version] = { number: "8.1.1" }
|
14
|
+
SearchFlip::Config[:version] = { number: "2.13", distribution: "opensearch" }
|
15
|
+
```
|
16
|
+
|
17
|
+
## v3.8.0
|
5
18
|
|
6
19
|
* Support Opensearch 1.x and 2.x
|
7
20
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -98,6 +98,16 @@ Available config options are:
|
|
98
98
|
* `auto_refresh` tells SearchFlip to automatically refresh an index after
|
99
99
|
import, index, delete, etc operations. This is e.g. useful for testing, etc.
|
100
100
|
Defaults to false.
|
101
|
+
* `version` allows to configure the elasticsearch version no matter which
|
102
|
+
elasticsearch version is actually in use. The version information is needed to
|
103
|
+
support version dependent features. Please note that manually configuring the
|
104
|
+
version is usually not need as the version by default is determined by sending
|
105
|
+
one request to elasticsearch.
|
106
|
+
|
107
|
+
```ruby
|
108
|
+
SearchFlip::Config[:version] = { number: "8.1.1" }
|
109
|
+
SearchFlip::Config[:version] = { number: "2.13", distribution: "opensearch" }
|
110
|
+
```
|
101
111
|
|
102
112
|
## Usage
|
103
113
|
|
@@ -26,7 +26,7 @@ module SearchFlip
|
|
26
26
|
# @return [String] The Elasticsearch distribution
|
27
27
|
|
28
28
|
def distribution
|
29
|
-
@distribution ||= SearchFlip::JSON.parse(version_response.to_s)["version"]["distribution"]
|
29
|
+
@distribution ||= SearchFlip::Config.dig(:version, :distribution) || SearchFlip::JSON.parse(version_response.to_s)["version"]["distribution"]
|
30
30
|
end
|
31
31
|
|
32
32
|
# Queries and returns the Elasticsearch version used.
|
@@ -37,7 +37,7 @@ module SearchFlip
|
|
37
37
|
# @return [String] The Elasticsearch version
|
38
38
|
|
39
39
|
def version
|
40
|
-
@version ||= SearchFlip::JSON.parse(version_response.to_s)["version"]["number"]
|
40
|
+
@version ||= SearchFlip::Config.dig(:version, :number) || SearchFlip::JSON.parse(version_response.to_s)["version"]["number"]
|
41
41
|
end
|
42
42
|
|
43
43
|
# Queries and returns the Elasticsearch cluster health.
|
data/lib/search_flip/version.rb
CHANGED
@@ -5,12 +5,28 @@ RSpec.describe SearchFlip::Connection do
|
|
5
5
|
it "reutrns the distribution" do
|
6
6
|
expect([nil, "opensearch"]).to include(SearchFlip::Connection.new.distribution)
|
7
7
|
end
|
8
|
+
|
9
|
+
it "returns the distribution from the config when given" do
|
10
|
+
SearchFlip::Config[:version] = { distribution: "distribution" }
|
11
|
+
|
12
|
+
expect(SearchFlip::Connection.new.distribution).to eq("distribution")
|
13
|
+
ensure
|
14
|
+
SearchFlip::Config.delete(:version)
|
15
|
+
end
|
8
16
|
end
|
9
17
|
|
10
18
|
describe "#version" do
|
11
19
|
it "returns the version" do
|
12
20
|
expect(SearchFlip::Connection.new.version).to match(/\A[0-9.]+\z/)
|
13
21
|
end
|
22
|
+
|
23
|
+
it "returns the version from the config when given" do
|
24
|
+
SearchFlip::Config[:version] = { number: "1.2.3" }
|
25
|
+
|
26
|
+
expect(SearchFlip::Connection.new.version).to eq("1.2.3")
|
27
|
+
ensure
|
28
|
+
SearchFlip::Config.delete(:version)
|
29
|
+
end
|
14
30
|
end
|
15
31
|
|
16
32
|
describe "#cluster_health" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: search_flip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Vetter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|