Class: Sunspot::Type::TextType

Inherits:
AbstractType show all
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.

Instance Method Summary collapse

Methods inherited from AbstractType

#to_literal

Instance Method Details

#accepts_dynamic?Boolean

Returns:

  • (Boolean)


106
107
108
# File 'lib/sunspot/type.rb', line 106

def accepts_dynamic?
  false
end

#accepts_more_like_this?Boolean

Returns:

  • (Boolean)


110
111
112
# File 'lib/sunspot/type.rb', line 110

def accepts_more_like_this?
  true
end

#cast(text) ⇒ Object



102
103
104
# File 'lib/sunspot/type.rb', line 102

def cast(text)
  text
end

#indexed_name(name) ⇒ Object

:nodoc:



94
95
96
# File 'lib/sunspot/type.rb', line 94

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

#to_indexed(value) ⇒ Object

:nodoc:



98
99
100
# File 'lib/sunspot/type.rb', line 98

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