Class: Sunspot::Query::TextFieldBoost

Inherits:
Object
  • Object
show all
Defined in:
lib/sunspot/query/text_field_boost.rb

Overview

:nodoc:

Instance Method Summary collapse

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_fieldObject



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