Class: Elasticband::Query::ScoreFunction::ScriptScore

Inherits:
Elasticband::Query::ScoreFunction show all
Defined in:
lib/elasticband/query/score_function/script_score.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(script, options = {}) ⇒ ScriptScore

Returns a new instance of ScriptScore.



7
8
9
10
# File 'lib/elasticband/query/score_function/script_score.rb', line 7

def initialize(script, options = {})
  self.script = script
  self.options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/elasticband/query/score_function/script_score.rb', line 5

def options
  @options
end

#scriptObject

Returns the value of attribute script.



5
6
7
# File 'lib/elasticband/query/score_function/script_score.rb', line 5

def script
  @script
end

Instance Method Details

#to_hObject



12
13
14
# File 'lib/elasticband/query/score_function/script_score.rb', line 12

def to_h
  { script_score: script_score_hash }
end