Class: Sunspot::FulltextField
- Inherits:
-
Field
- Object
- Field
- Sunspot::FulltextField
- Defined in:
- sunspot/lib/sunspot/field.rb
Overview
FulltextField instances represent fields that are indexed as fulltext. These fields are tokenized in the index, and can have boost applied to them. They also always allow multiple values (since the only downside of allowing multiple values is that it prevents the field from being sortable, and sorting on tokenized fields is nonsensical anyway, there is no reason to do otherwise). FulltextField instances always have the type TextType.
Instance Attribute Summary (collapse)
-
- (Object) default_boost
readonly
:nodoc:.
Attributes inherited from Field
boost, indexed_name, name, reference, type
Instance Method Summary (collapse)
- - (Object) indexed_name
-
- (FulltextField) initialize(name, options = {})
constructor
A new instance of FulltextField.
Methods inherited from Field
#cast, #eql?, #hash, #more_like_this?, #multiple?, #to_indexed
Constructor Details
- (FulltextField) initialize(name, options = {})
A new instance of FulltextField
126 127 128 129 130 131 132 |
# File 'sunspot/lib/sunspot/field.rb', line 126 def initialize(name, = {}) super(name, Type::TextType.instance, ) @multiple = true @boost = .delete(:boost) @default_boost = .delete(:default_boost) raise ArgumentError, "Unknown field option #{.keys.first.inspect} provided for field #{name.inspect}" unless .empty? end |
Instance Attribute Details
- (Object) default_boost (readonly)
:nodoc:
124 125 126 |
# File 'sunspot/lib/sunspot/field.rb', line 124 def default_boost @default_boost end |
Instance Method Details
- (Object) indexed_name
134 135 136 |
# File 'sunspot/lib/sunspot/field.rb', line 134 def indexed_name "#{super}" end |