# File lib/thinking_sphinx/real_time/index/template.rb, line 4 def initialize(index) @index = index end
# 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
# 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
# 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
# File lib/thinking_sphinx/real_time/index/template.rb, line 31 def class_column [:class, :name] end