opensearch-ruby 3.2.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 419497e48fbb6859275f24629079b21861fcca68bebb7f91254e8d912e216ced
4
- data.tar.gz: 4de9071cd2a940c459864ddc4e89fa27e837ce74f3cfd3cfa719ac2ef3f534a5
3
+ metadata.gz: eb87cfb56648460b74a2ae459b729860b515d115b4d801c4607a21ee591e2269
4
+ data.tar.gz: 8466da7f17c294d4c1c78fd69101c0c809a6e2d3938e7afaa0186f5dd3995fae
5
5
  SHA512:
6
- metadata.gz: df16ea05cb84a645a968ba8c4431b7be168fbaa47c841d02acd2015f46b82b57f7ebf3b8cea3e70b886379fe4ac2e6d73d79e92009baf85ac563a52f1806c5bf
7
- data.tar.gz: f63990cbb5dc776c28aa88ff2e53db4861e75be8c97595784e2a7dd25ad9b4990e0878c90d5f831f3fe7d07a046f6577d98766b1e793cf8ef5ee60f4d4dc7768
6
+ metadata.gz: cc5ed4d0b4c0bb30dbbd1a1bc0a3dab182158cd1d095c338c213e94ffe33afdbd16212c68b3457a79f05abebbd61a1b2066336b61c1b8cf874f3766b4d26d203
7
+ data.tar.gz: ca0c548400b58f48b9ec44bfd126186e7be455ee12f8174d9db916504e989a3cd7d974165faebc7f3314f1b416914bc95a321f57472ede7bc61db6937452e20e
checksums.yaml.gz.sig CHANGED
Binary file
@@ -0,0 +1,62 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ #
3
+ # The OpenSearch Contributors require contributions made to
4
+ # this file be licensed under the Apache-2.0 license or a
5
+ # compatible open source license.
6
+
7
+ module OpenSearch
8
+ module DSL
9
+ module Search
10
+ module Queries
11
+ # A query which wraps another query and returns a customized score for matching documents
12
+ #
13
+ # @example
14
+ #
15
+ # search do
16
+ # query do
17
+ # script_score do
18
+ # query do
19
+ # match content: 'Twitter'
20
+ # end
21
+ #
22
+ # script source: "_score * params['multiplier']",
23
+ # params: { multiplier: 2.0 }
24
+ # end
25
+ # end
26
+ # end
27
+ #
28
+ # @see https://opensearch.org/docs/latest/query-dsl/specialized/script-score/
29
+ #
30
+ class ScriptScore
31
+ include BaseComponent
32
+
33
+ option_method :script
34
+ option_method :min_score
35
+ option_method :boost
36
+
37
+ # DSL method for building the `query` part of the query definition
38
+ #
39
+ # @return [self]
40
+ #
41
+ def query(*args, &block)
42
+ @query = block ? @query = Query.new(*args, &block) : args.first
43
+ self
44
+ end
45
+
46
+ # Converts the query definition to a Hash
47
+ #
48
+ # @return [Hash]
49
+ #
50
+ def to_hash
51
+ hash = super
52
+ if @query
53
+ _query = @query.respond_to?(:to_hash) ? @query.to_hash : @query
54
+ hash[name].update(query: _query)
55
+ end
56
+ hash
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -250,7 +250,7 @@ module OpenSearch
250
250
  end
251
251
 
252
252
  def respond_to_missing?(method_name, include_private = false)
253
- @options.respond_to?(name) || super
253
+ @options.respond_to?(method_name) || super
254
254
  end
255
255
 
256
256
  # Converts the search definition to a Hash
@@ -25,5 +25,5 @@
25
25
  # under the License.
26
26
 
27
27
  module OpenSearch
28
- VERSION = '3.2.0'.freeze
28
+ VERSION = '3.4.0'.freeze
29
29
  end
data/lib/opensearch.rb CHANGED
@@ -49,7 +49,7 @@ module OpenSearch
49
49
  end
50
50
 
51
51
  def respond_to_missing?(method_name, include_private = false)
52
- name == :perform_request || super
52
+ method_name == :perform_request || super
53
53
  end
54
54
 
55
55
  private
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: 3.2.0
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
@@ -31,7 +31,7 @@ cert_chain:
31
31
  1DlemA1SsUBIoF7CwtVd/RTG/K1iT6nBD08fdKxodMhI5ujkP3N7gkxzRf6aKN4z
32
32
  glnDJYZjluKBUsKTOLdPW1CZpb0AHLpNqDf8SVHsPFk=
33
33
  -----END CERTIFICATE-----
34
- date: 2024-04-16 00:00:00.000000000 Z
34
+ date: 2024-07-11 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: faraday
@@ -445,6 +445,7 @@ files:
445
445
  - lib/opensearch/dsl/search/queries/query_string.rb
446
446
  - lib/opensearch/dsl/search/queries/range.rb
447
447
  - lib/opensearch/dsl/search/queries/regexp.rb
448
+ - lib/opensearch/dsl/search/queries/script_score.rb
448
449
  - lib/opensearch/dsl/search/queries/simple_query_string.rb
449
450
  - lib/opensearch/dsl/search/queries/span_first.rb
450
451
  - lib/opensearch/dsl/search/queries/span_multi.rb
@@ -539,7 +540,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
539
540
  - !ruby/object:Gem::Version
540
541
  version: '0'
541
542
  requirements: []
542
- rubygems_version: 3.3.26
543
+ rubygems_version: 3.3.27
543
544
  signing_key:
544
545
  specification_version: 4
545
546
  summary: Ruby Client for OpenSearch
metadata.gz.sig CHANGED
Binary file