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

instance, #to_literal

Instance Method Details

#accepts_dynamic?Boolean

Returns:

  • (Boolean)

104
105
106
# File 'lib/sunspot/type.rb', line 104

def accepts_dynamic?
  false
end

#accepts_more_like_this?Boolean

Returns:

  • (Boolean)

108
109
110
# File 'lib/sunspot/type.rb', line 108

def accepts_more_like_this?
  true
end

#cast(text) ⇒ Object


100
101
102
# File 'lib/sunspot/type.rb', line 100

def cast(text)
  text
end

#indexed_name(name) ⇒ Object

:nodoc:


92
93
94
# File 'lib/sunspot/type.rb', line 92

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

#to_indexed(value) ⇒ Object

:nodoc:


96
97
98
# File 'lib/sunspot/type.rb', line 96

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