Class: ThinkingSphinx::RealTime::Index::Template
- Inherits:
-
Object
- Object
- ThinkingSphinx::RealTime::Index::Template
- Defined in:
- lib/thinking_sphinx/real_time/index/template.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(index) ⇒ Template
constructor
A new instance of Template.
Constructor Details
#initialize(index) ⇒ Template
Returns a new instance of Template.
6 7 8 |
# File 'lib/thinking_sphinx/real_time/index/template.rb', line 6 def initialize(index) @index = index end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
4 5 6 |
# File 'lib/thinking_sphinx/real_time/index/template.rb', line 4 def index @index end |
Instance Method Details
#apply ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/thinking_sphinx/real_time/index/template.rb', line 10 def apply add_field class_column, :sphinx_internal_class_name add_attribute primary_key, :sphinx_internal_id, :bigint add_attribute class_column, :sphinx_internal_class, :string, :facet => true add_attribute 0, :sphinx_deleted, :integer if add_attribute -> (_) { Time.current.to_i }, :sphinx_updated_at, :timestamp end end |