opensearch-ruby 3.3.0 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/opensearch/dsl/search/queries/script_score.rb +62 -0
- data/lib/opensearch/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb87cfb56648460b74a2ae459b729860b515d115b4d801c4607a21ee591e2269
|
4
|
+
data.tar.gz: 8466da7f17c294d4c1c78fd69101c0c809a6e2d3938e7afaa0186f5dd3995fae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/opensearch/version.rb
CHANGED
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.
|
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-
|
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
|
metadata.gz.sig
CHANGED
Binary file
|