class Solr::Query::Request::Boosting::FieldValueLessThanBoostFunction

Attributes

boost_magnitude[R]
field[R]
max[R]

Public Class Methods

new(field:, max:, boost_magnitude:) click to toggle source
# File lib/solr/query/request/boosting/field_value_less_than_boost_function.rb, line 10
def initialize(field:, max:, boost_magnitude:)
  @field = field
  @max = max
  @boost_magnitude = boost_magnitude
  freeze
end

Public Instance Methods

to_solr_s() click to toggle source
# File lib/solr/query/request/boosting/field_value_less_than_boost_function.rb, line 17
def to_solr_s
  solr_field = solarize_field(field)
  "if(sub(#{max},max(#{solr_field},#{max})),1,#{boost_magnitude})"
end