Class: Sunspot::Query::TextFieldBoost
- Inherits:
-
Object
- Object
- Sunspot::Query::TextFieldBoost
- Defined in:
- lib/sunspot/query/text_field_boost.rb
Overview
:nodoc:
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.
4 5 6 |
# File 'lib/sunspot/query/text_field_boost.rb', line 4 def initialize(field, boost = nil) @field, @boost = field, boost end |
Instance Method Details
#to_boosted_field ⇒ Object
8 9 10 11 12 |
# File 'lib/sunspot/query/text_field_boost.rb', line 8 def to_boosted_field boosted_field = @field.indexed_name boosted_field.concat("^#{@boost}") if @boost boosted_field end |