Class: Elasticband::Query::FunctionScore

Inherits:
Elasticband::Query show all
Defined in:
lib/elasticband/query/function_score.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Elasticband::Query

parse

Constructor Details

#initialize(query_or_filter, function, score_mode, boost_mode) ⇒ FunctionScore

Returns a new instance of FunctionScore.



6
7
8
9
10
11
# File 'lib/elasticband/query/function_score.rb', line 6

def initialize(query_or_filter, function, score_mode, boost_mode)
  self.query_or_filter = query_or_filter
  self.function = function
  self.score_mode = score_mode
  self.boost_mode = boost_mode
end

Instance Attribute Details

#boost_modeObject

Returns the value of attribute boost_mode.



4
5
6
# File 'lib/elasticband/query/function_score.rb', line 4

def boost_mode
  @boost_mode
end

#functionObject

Returns the value of attribute function.



4
5
6
# File 'lib/elasticband/query/function_score.rb', line 4

def function
  @function
end

#query_or_filterObject

Returns the value of attribute query_or_filter.



4
5
6
# File 'lib/elasticband/query/function_score.rb', line 4

def query_or_filter
  @query_or_filter
end

#score_modeObject

Returns the value of attribute score_mode.



4
5
6
# File 'lib/elasticband/query/function_score.rb', line 4

def score_mode
  @score_mode
end

Instance Method Details

#to_hObject



13
14
15
# File 'lib/elasticband/query/function_score.rb', line 13

def to_h
  { function_score: function_score_hash }
end