Class: Solr::Query::Request::FieldWithBoost
- Inherits:
-
Object
- Object
- Solr::Query::Request::FieldWithBoost
- Defined in:
- lib/solr/query/request/field_with_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.
Instance Method Summary collapse
-
#initialize(field:, boost_magnitude: Solr::Query::Request::BoostMagnitude::DEFAULT) ⇒ FieldWithBoost
constructor
A new instance of FieldWithBoost.
- #to_solr_s ⇒ Object
Constructor Details
#initialize(field:, boost_magnitude: Solr::Query::Request::BoostMagnitude::DEFAULT) ⇒ FieldWithBoost
Returns a new instance of FieldWithBoost.
7 8 9 10 |
# File 'lib/solr/query/request/field_with_boost.rb', line 7 def initialize(field:, boost_magnitude: Solr::Query::Request::BoostMagnitude::DEFAULT) @field = field @boost_magnitude = boost_magnitude end |
Instance Attribute Details
#boost_magnitude ⇒ Object (readonly)
Returns the value of attribute boost_magnitude.
5 6 7 |
# File 'lib/solr/query/request/field_with_boost.rb', line 5 def boost_magnitude @boost_magnitude end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
5 6 7 |
# File 'lib/solr/query/request/field_with_boost.rb', line 5 def field @field end |
Instance Method Details
#to_solr_s ⇒ Object
12 13 14 |
# File 'lib/solr/query/request/field_with_boost.rb', line 12 def to_solr_s "#{field}^#{boost_magnitude}" end |