Class: Solr::Query::Request::Boosting::FieldValueLessThanBoostFunction
- Inherits:
-
Object
- Object
- Solr::Query::Request::Boosting::FieldValueLessThanBoostFunction
- Includes:
- Support::SchemaHelper
- Defined in:
- lib/solr/query/request/boosting/field_value_less_than_boost_function.rb
Instance Attribute Summary collapse
-
#boost_magnitude ⇒ Object
readonly
Returns the value of attribute boost_magnitude.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#max ⇒ Object
readonly
Returns the value of attribute max.
Instance Method Summary collapse
-
#initialize(field:, max:, boost_magnitude:) ⇒ FieldValueLessThanBoostFunction
constructor
A new instance of FieldValueLessThanBoostFunction.
- #to_solr_s ⇒ Object
Methods included from Support::SchemaHelper
Constructor Details
#initialize(field:, max:, boost_magnitude:) ⇒ FieldValueLessThanBoostFunction
Returns a new instance of FieldValueLessThanBoostFunction.
10 11 12 13 14 15 |
# 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 |
Instance Attribute Details
#boost_magnitude ⇒ Object (readonly)
Returns the value of attribute boost_magnitude.
8 9 10 |
# File 'lib/solr/query/request/boosting/field_value_less_than_boost_function.rb', line 8 def boost_magnitude @boost_magnitude end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
8 9 10 |
# File 'lib/solr/query/request/boosting/field_value_less_than_boost_function.rb', line 8 def field @field end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
8 9 10 |
# File 'lib/solr/query/request/boosting/field_value_less_than_boost_function.rb', line 8 def max @max end |
Instance Method Details
#to_solr_s ⇒ Object
17 18 19 20 |
# 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 |