Class: FunctionScores::ScriptScoreFunctionBuilder
- Inherits:
-
ScoreFunctionBuilder
- Object
- ScoreFunctionBuilder
- FunctionScores::ScriptScoreFunctionBuilder
- Defined in:
- lib/function_scores/script_score_function_builder.rb
Overview
A function that uses a script to compute or influence the score of documents that match with the inner query or filter.
Instance Method Summary collapse
-
#function ⇒ Hash
Serialized json query for the object.
-
#initialize(script:) ⇒ ScriptScoreFunctionBuilder
constructor
A new instance of ScriptScoreFunctionBuilder.
Methods inherited from ScoreFunctionBuilder
Methods included from AttributesReader
Constructor Details
#initialize(script:) ⇒ ScriptScoreFunctionBuilder
Returns a new instance of ScriptScoreFunctionBuilder.
12 13 14 |
# File 'lib/function_scores/script_score_function_builder.rb', line 12 def initialize(script:) @script = script end |
Instance Method Details
#function ⇒ Hash
Returns serialized json query for the object.
17 18 19 20 21 22 23 |
# File 'lib/function_scores/script_score_function_builder.rb', line 17 def function function = {} ss_query = super ss_query[:script] = @script.settings function[name.intern] = ss_query function end |