Class: Sunspot::Type::TextType

Inherits:
AbstractType show all
Defined in:
sunspot/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

- (Boolean) accepts_dynamic?

Returns:

  • (Boolean)


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

def accepts_dynamic?
  false
end

- (Boolean) accepts_more_like_this?

Returns:

  • (Boolean)


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

def accepts_more_like_this?
  true
end

- (Object) cast(text)



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

def cast(text)
  text
end

- (Object) indexed_name(name)

:nodoc:



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

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

- (Object) to_indexed(value)

:nodoc:



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

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