Class: Sunspot::FulltextField
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
Attributes inherited from Field
#attributes, #name, #reference, #type
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ FulltextField
constructor
:nodoc:.
Methods inherited from Field
#cast, #indexed_name, #multiple?, #to_indexed
Constructor Details
#initialize(name, options = {}) ⇒ FulltextField
:nodoc:
90 91 92 93 94 95 96 97 |
# File 'lib/sunspot/field.rb', line 90 def initialize(name, = {}) super(name, Type::TextType) if .has_key?(:boost) @attributes[:boost] = .delete(:boost) end @multiple = true raise ArgumentError, "Unknown field option #{.keys.first.inspect} provided for field #{name.inspect}" unless .empty? end |