Class: Solr::Query::Request::FieldWithBoost

Inherits:
Object
  • Object
show all
Defined in:
lib/solr/query/request/field_with_boost.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_magnitudeObject (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

#fieldObject (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_sObject



12
13
14
# File 'lib/solr/query/request/field_with_boost.rb', line 12

def to_solr_s
  "#{field}^#{boost_magnitude}"
end