class ThinkingSphinx::RealTime::Index::Template
Attributes
index[R]
Public Class Methods
new(index)
click to toggle source
# File lib/thinking_sphinx/real_time/index/template.rb, line 4 def initialize(index) @index = index end
Public Instance Methods
apply()
click to toggle source
# File lib/thinking_sphinx/real_time/index/template.rb, line 8 def apply add_field class_column, :sphinx_internal_class_name add_attribute :id, :sphinx_internal_id, :integer add_attribute class_column, :sphinx_internal_class, :string, :facet => true add_attribute 0, :sphinx_deleted, :integer end
Private Instance Methods
add_attribute(column, name, type, options = {})
click to toggle source
# File lib/thinking_sphinx/real_time/index/template.rb, line 18 def add_attribute(column, name, type, options = {}) index.add_attribute ThinkingSphinx::RealTime::Attribute.new( ThinkingSphinx::ActiveRecord::Column.new(*column), options.merge(:as => name, :type => type) ) end
add_field(column, name)
click to toggle source
# File lib/thinking_sphinx/real_time/index/template.rb, line 25 def add_field(column, name) index.add_field ThinkingSphinx::RealTime::Field.new( ThinkingSphinx::ActiveRecord::Column.new(*column), :as => name ) end
class_column()
click to toggle source
# File lib/thinking_sphinx/real_time/index/template.rb, line 31 def class_column [:class, :name] end