Class: Sunspot::Query::TextFieldBoost
- Inherits:
-
Object
- Object
- Sunspot::Query::TextFieldBoost
- Defined in:
- lib/sunspot/query/text_field_boost.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#boost ⇒ Object
readonly
Returns the value of attribute boost.
Instance Method Summary collapse
-
#initialize(field, boost = nil) ⇒ TextFieldBoost
constructor
A new instance of TextFieldBoost.
- #to_boosted_field ⇒ Object
Constructor Details
#initialize(field, boost = nil) ⇒ TextFieldBoost
Returns a new instance of TextFieldBoost.
6 7 8 |
# File 'lib/sunspot/query/text_field_boost.rb', line 6 def initialize(field, boost = nil) @field, @boost = field, boost end |
Instance Attribute Details
#boost ⇒ Object (readonly)
Returns the value of attribute boost.
4 5 6 |
# File 'lib/sunspot/query/text_field_boost.rb', line 4 def boost @boost end |
Instance Method Details
#to_boosted_field ⇒ Object
10 11 12 13 14 |
# File 'lib/sunspot/query/text_field_boost.rb', line 10 def to_boosted_field boosted_field = @field.indexed_name boosted_field.concat("^#{@boost}") if @boost boosted_field end |