Module: Sunspot::Type::TextType

Defined in:
lib/sunspot/type.rb

Overview

Text is a special type that stores data for fulltext search. Unlike other types, Text fields are tokenized and are made available to the keyword search phrase. Text fields cannot be faceted, ordered upon, or used in restrictions. Similarly, text fields are the only fields that are made available to keyword search.

Class Method Summary collapse

Class Method Details

.cast(text) ⇒ Object



37
38
39
# File 'lib/sunspot/type.rb', line 37

def cast(text)
  text
end

.indexed_name(name) ⇒ Object

:nodoc:



29
30
31
# File 'lib/sunspot/type.rb', line 29

def indexed_name(name) #:nodoc:
"#{name}_text"
end

.to_indexed(value) ⇒ Object

:nodoc:



33
34
35
# File 'lib/sunspot/type.rb', line 33

def to_indexed(value) #:nodoc:
  value.to_s if value
end