opensearch-ruby 4.0.0.pre.beta.4 → 4.0.0.pre.beta.5
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
- checksums.yaml.gz.sig +0 -0
- data/README.md +1 -3
- data/lib/opensearch/api.rb +1 -1
- data/lib/opensearch/transport/client.rb +1 -3
- data/lib/opensearch/transport/transport/base.rb +1 -1
- data/lib/opensearch/transport/transport/serializer/{multi_json.rb → json.rb} +8 -4
- data/lib/opensearch/transport.rb +2 -2
- data/lib/opensearch/version.rb +1 -1
- data/opensearch-ruby.gemspec +1 -2
- data/spec/spec_helper.rb +1 -1
- data/test/transport/integration/transport_test.rb +1 -1
- data/test/transport/unit/serializer_test.rb +5 -5
- data.tar.gz.sig +0 -0
- metadata +7 -27
- metadata.gz.sig +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3872c0c4466fe1c37a1732bf74624264530deb5da6e9a5abeb5343ca8b940ffb
|
4
|
+
data.tar.gz: 9c92adf323965443993e90da36d64b3200b717303c7dac47a0e20179e025af9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f998b61dc76a8f5ff77be3dd75f5a52088cebc3f81a0ce7f011f90485d37a7a48b7701bf745b1d8487070b870131639cc5ac5ca3faa1e702efbd0532edc60f8f
|
7
|
+
data.tar.gz: cdbd89cb59925c945b065e3bf20dca9ca37fb51488b12f89b507b1ab2268e4f604d052a0f9d7c2a180b4d3ad55046741c1f4259dc2fdb3fffcf450467027300e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -59,14 +59,12 @@ If you don't use Bundler, you may need to require the library explicitly (like `
|
|
59
59
|
|
60
60
|
Currently these libraries will be automatically detected and used:
|
61
61
|
- [Patron](https://github.com/toland/patron) through [faraday-patron](https://github.com/lostisland/faraday-patron)
|
62
|
-
- [Typhoeus](https://github.com/typhoeus/typhoeus) through [faraday-typhoeus](https://github.com/dleavitt/faraday-typhoeus)
|
62
|
+
- [Typhoeus](https://github.com/typhoeus/typhoeus) through [faraday-typhoeus](https://github.com/dleavitt/faraday-typhoeus)
|
63
63
|
- [HTTPClient](https://rubygems.org/gems/httpclient) through [faraday-httpclient](https://github.com/lostisland/faraday-httpclient)
|
64
64
|
- [Net::HTTP::Persistent](https://rubygems.org/gems/net-http-persistent) through [faraday-net_http_persistent](https://github.com/lostisland/faraday-net_http_persistent)
|
65
65
|
|
66
66
|
**Note on [Typhoeus](https://github.com/typhoeus/typhoeus)**: You need to use v1.4.0 or up since older versions are not compatible with Faraday 1.0 or higher.
|
67
67
|
|
68
|
-
**Note on [Faraday](https://rubygems.org/gems/faraday)**: If you use Faraday 2.0 or higher, if the adapter is in a separate gem, you will likely need to declare that gem as well. Only the Net::HTTP adapter gem is included by default. Faraday 1.x includes most common adapter gems already.
|
69
|
-
|
70
68
|
## DSL Features
|
71
69
|
|
72
70
|
The `opensearch-dsl` library provides a Ruby API for the `OpenSearch Query DSL`.
|
data/lib/opensearch/api.rb
CHANGED
@@ -19,7 +19,7 @@ module OpenSearch
|
|
19
19
|
'filter_path' # Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
|
20
20
|
]).freeze
|
21
21
|
|
22
|
-
DEFAULT_SERIALIZER =
|
22
|
+
DEFAULT_SERIALIZER = Transport::Transport::Serializer::JSON.new
|
23
23
|
|
24
24
|
def self.serializer
|
25
25
|
settings[:serializer] || DEFAULT_SERIALIZER
|
@@ -366,10 +366,8 @@ module OpenSearch
|
|
366
366
|
#
|
367
367
|
def __auto_detect_adapter
|
368
368
|
# Get the Faraday adapter list without initializing it.
|
369
|
-
adapter = if Faraday::Adapter.respond_to?(:registered_middleware)
|
369
|
+
adapter = if Faraday::Adapter.respond_to?(:registered_middleware)
|
370
370
|
->(name) { Faraday::Adapter.registered_middleware[name] }
|
371
|
-
elsif Faraday::Adapter.respond_to?(:fetch_middleware) # Faraday 1.x
|
372
|
-
->(name) { Faraday::Adapter.fetch_middleware(name) }
|
373
371
|
else
|
374
372
|
{} # fallback behavior that should never happen
|
375
373
|
end
|
@@ -37,7 +37,7 @@ module OpenSearch
|
|
37
37
|
DEFAULT_RELOAD_AFTER = 10_000 # Requests
|
38
38
|
DEFAULT_RESURRECT_AFTER = 60 # Seconds
|
39
39
|
DEFAULT_MAX_RETRIES = 3 # Requests
|
40
|
-
DEFAULT_SERIALIZER_CLASS = Serializer::
|
40
|
+
DEFAULT_SERIALIZER_CLASS = Serializer::JSON
|
41
41
|
SANITIZED_PASSWORD = '*' * rand(1..14)
|
42
42
|
|
43
43
|
attr_reader :hosts, :options, :connections, :counter, :last_request_at, :protocol
|
@@ -38,21 +38,25 @@ module OpenSearch
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
# A default JSON serializer (using [
|
41
|
+
# A default JSON serializer (using [json](http://rubygems.org/gems/json))
|
42
42
|
#
|
43
|
-
class
|
43
|
+
class JSON
|
44
44
|
include Base
|
45
45
|
|
46
46
|
# De-serialize a Hash from JSON string
|
47
47
|
#
|
48
48
|
def load(string, options = {})
|
49
|
-
::
|
49
|
+
::JSON.parse(string, options)
|
50
50
|
end
|
51
51
|
|
52
52
|
# Serialize a Hash to JSON string
|
53
53
|
#
|
54
54
|
def dump(object, options = {})
|
55
|
-
|
55
|
+
if options.delete(:pretty)
|
56
|
+
::JSON.pretty_generate(object, options)
|
57
|
+
else
|
58
|
+
::JSON.generate(object, options)
|
59
|
+
end
|
56
60
|
end
|
57
61
|
end
|
58
62
|
end
|
data/lib/opensearch/transport.rb
CHANGED
@@ -27,11 +27,11 @@
|
|
27
27
|
require 'uri'
|
28
28
|
require 'time'
|
29
29
|
require 'timeout'
|
30
|
-
require '
|
30
|
+
require 'json'
|
31
31
|
require 'faraday'
|
32
32
|
|
33
33
|
require 'opensearch/transport/transport/loggable'
|
34
|
-
require 'opensearch/transport/transport/serializer/
|
34
|
+
require 'opensearch/transport/transport/serializer/json'
|
35
35
|
require 'opensearch/transport/transport/sniffer'
|
36
36
|
require 'opensearch/transport/transport/response'
|
37
37
|
require 'opensearch/transport/transport/errors'
|
data/lib/opensearch/version.rb
CHANGED
data/opensearch-ruby.gemspec
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -48,7 +48,7 @@ if defined?(JRUBY_VERSION)
|
|
48
48
|
require 'pry-nav'
|
49
49
|
else
|
50
50
|
require 'faraday/patron'
|
51
|
-
require 'faraday/typhoeus'
|
51
|
+
require 'faraday/typhoeus'
|
52
52
|
require 'opensearch/transport/transport/http/curb'
|
53
53
|
require 'curb'
|
54
54
|
end
|
@@ -37,7 +37,7 @@ class OpenSearch::Transport::ClientIntegrationTest < Minitest::Test
|
|
37
37
|
# Require the library so autodetection finds it.
|
38
38
|
require 'typhoeus'
|
39
39
|
# Require the adapter so autodetection finds it.
|
40
|
-
require 'faraday/typhoeus'
|
40
|
+
require 'faraday/typhoeus'
|
41
41
|
|
42
42
|
transport = OpenSearch::Transport::Transport::HTTP::Faraday.new \
|
43
43
|
:hosts => [ { host: @host, port: @port } ] do |f|
|
@@ -30,11 +30,11 @@ class OpenSearch::Transport::Transport::SerializerTest < Minitest::Test
|
|
30
30
|
|
31
31
|
context "Serializer" do
|
32
32
|
|
33
|
-
should "use
|
34
|
-
::
|
35
|
-
::
|
36
|
-
OpenSearch::Transport::Transport::Serializer::
|
37
|
-
OpenSearch::Transport::Transport::Serializer::
|
33
|
+
should "use JSON by default" do
|
34
|
+
::JSON.expects(:parse)
|
35
|
+
::JSON.expects(:generate)
|
36
|
+
OpenSearch::Transport::Transport::Serializer::JSON.new.load('{}')
|
37
|
+
OpenSearch::Transport::Transport::Serializer::JSON.new.dump({})
|
38
38
|
end
|
39
39
|
|
40
40
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opensearch-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.pre.beta.
|
4
|
+
version: 4.0.0.pre.beta.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
@@ -31,28 +31,22 @@ cert_chain:
|
|
31
31
|
m0rB25J1sO2yjlalRdBoV5p7OKaWG4CGMr+q6vCC2za7yrtZiYOOv+KpWmheTwds
|
32
32
|
P1nbdIL2eAXGfNU3cbtYisS1sSYi7VSkS52pVk8Jgtw=
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2025-
|
34
|
+
date: 2025-05-01 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: faraday
|
38
38
|
requirement: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- - "
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '1.0'
|
43
|
-
- - "<"
|
40
|
+
- - "~>"
|
44
41
|
- !ruby/object:Gem::Version
|
45
|
-
version: '
|
42
|
+
version: '2.0'
|
46
43
|
type: :runtime
|
47
44
|
prerelease: false
|
48
45
|
version_requirements: !ruby/object:Gem::Requirement
|
49
46
|
requirements:
|
50
|
-
- - "
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: '1.0'
|
53
|
-
- - "<"
|
47
|
+
- - "~>"
|
54
48
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
49
|
+
version: '2.0'
|
56
50
|
- !ruby/object:Gem::Dependency
|
57
51
|
name: logger
|
58
52
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,20 +61,6 @@ dependencies:
|
|
67
61
|
- - ">="
|
68
62
|
- !ruby/object:Gem::Version
|
69
63
|
version: '0'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: multi_json
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '1.0'
|
77
|
-
type: :runtime
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '1.0'
|
84
64
|
description: |
|
85
65
|
OpenSearch Ruby is a Ruby client for OpenSearch. You can use the client to
|
86
66
|
execute OpenSearch API commands, and build OpenSearch queries and aggregations
|
@@ -649,7 +629,7 @@ files:
|
|
649
629
|
- lib/opensearch/transport/transport/http/manticore.rb
|
650
630
|
- lib/opensearch/transport/transport/loggable.rb
|
651
631
|
- lib/opensearch/transport/transport/response.rb
|
652
|
-
- lib/opensearch/transport/transport/serializer/
|
632
|
+
- lib/opensearch/transport/transport/serializer/json.rb
|
653
633
|
- lib/opensearch/transport/transport/sniffer.rb
|
654
634
|
- lib/opensearch/version.rb
|
655
635
|
- opensearch-ruby.gemspec
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
p��_%&X��f�\���{��J<�1J�v`
|
2
|
+
^Ƥ���Q^�AuOz��Mȥ���J=�g�n3Y[��([�W@�L�߁��N�9=��)�EF�(��qh������[H�(�d_���
|
3
|
+
#4ܻ����" Hɥ��Þ�I��]n丞�e/|f �?.�PA#��1.�x#1�#K�7��{���+6��L.JOb2�ܣ�v�������@���k�O�/(@��(;�������);t��)��!n�w��u�
|