Class: Solr::Query::Request::Boosting::LnFunctionBoost
- Inherits:
-
Object
- Object
- Solr::Query::Request::Boosting::LnFunctionBoost
- Includes:
- Support::SchemaHelper
- Defined in:
- lib/solr/query/request/boosting/ln_function_boost.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.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
Instance Method Summary collapse
-
#initialize(field:, min: 0.69, boost_magnitude: 1) ⇒ LnFunctionBoost
constructor
A new instance of LnFunctionBoost.
- #solr_field ⇒ Object
- #to_solr_s ⇒ Object
Methods included from Support::SchemaHelper
Constructor Details
#initialize(field:, min: 0.69, boost_magnitude: 1) ⇒ LnFunctionBoost
Returns a new instance of LnFunctionBoost.
10 11 12 13 14 15 |
# File 'lib/solr/query/request/boosting/ln_function_boost.rb', line 10 def initialize(field:, min: 0.69, boost_magnitude: 1) @field = field @min = min @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/ln_function_boost.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/ln_function_boost.rb', line 8 def field @field end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
8 9 10 |
# File 'lib/solr/query/request/boosting/ln_function_boost.rb', line 8 def min @min end |
Instance Method Details
#solr_field ⇒ Object
21 22 23 |
# File 'lib/solr/query/request/boosting/ln_function_boost.rb', line 21 def solr_field solarize_field(field) end |
#to_solr_s ⇒ Object
17 18 19 |
# File 'lib/solr/query/request/boosting/ln_function_boost.rb', line 17 def to_solr_s "mul(if(gt(#{solr_field},1),ln(#{solr_field}),#{min}),#{boost_magnitude})" end |