Class: Solr::Query::Request::Boosting::ExistsBoostFunction
- Inherits:
-
Object
- Object
- Solr::Query::Request::Boosting::ExistsBoostFunction
- Includes:
- Support::SchemaHelper
- Defined in:
- lib/solr/query/request/boosting/exists_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.
Instance Method Summary collapse
-
#initialize(field:, boost_magnitude:) ⇒ ExistsBoostFunction
constructor
A new instance of ExistsBoostFunction.
- #solr_field ⇒ Object
- #to_solr_s ⇒ Object
Methods included from Support::SchemaHelper
Constructor Details
#initialize(field:, boost_magnitude:) ⇒ ExistsBoostFunction
Returns a new instance of ExistsBoostFunction.
10 11 12 13 14 |
# File 'lib/solr/query/request/boosting/exists_boost_function.rb', line 10 def initialize(field:, boost_magnitude:) @field = field @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/exists_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/exists_boost_function.rb', line 8 def field @field end |
Instance Method Details
#solr_field ⇒ Object
20 21 22 |
# File 'lib/solr/query/request/boosting/exists_boost_function.rb', line 20 def solr_field solarize_field(field) end |
#to_solr_s ⇒ Object
16 17 18 |
# File 'lib/solr/query/request/boosting/exists_boost_function.rb', line 16 def to_solr_s "if(exists(#{solr_field}),#{boost_magnitude},1)" end |