Class: ThinkingSphinx::RealTime::Index

Inherits:
Riddle::Configuration::RealtimeIndex
  • Object
show all
Includes:
Core::Index
Defined in:
lib/thinking_sphinx/real_time/index.rb

Defined Under Namespace

Classes: Template

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from Core::Index

#delta?, #document_id_for_key, #interpret_definition!, #model, #render

Constructor Details

- (Index) initialize(reference, options = {})



6
7
8
9
10
11
12
13
14
# File 'lib/thinking_sphinx/real_time/index.rb', line 6

def initialize(reference, options = {})
  @fields     = []
  @attributes = []
  @conditions = []

  Template.new(self).apply

  super reference, options
end

Instance Attribute Details

- (Object) attributes



24
25
26
27
28
# File 'lib/thinking_sphinx/real_time/index.rb', line 24

def attributes
  interpret_definition!

  @attributes
end

- (Object) conditions



30
31
32
33
34
# File 'lib/thinking_sphinx/real_time/index.rb', line 30

def conditions
  interpret_definition!

  @conditions
end

- (Object) fields



40
41
42
43
44
# File 'lib/thinking_sphinx/real_time/index.rb', line 40

def fields
  interpret_definition!

  @fields
end

Instance Method Details

- (Object) add_attribute(attribute)



16
17
18
# File 'lib/thinking_sphinx/real_time/index.rb', line 16

def add_attribute(attribute)
  @attributes << attribute
end

- (Object) add_field(field)



20
21
22
# File 'lib/thinking_sphinx/real_time/index.rb', line 20

def add_field(field)
  @fields << field
end

- (Object) facets



36
37
38
# File 'lib/thinking_sphinx/real_time/index.rb', line 36

def facets
  properties.select(&:facet?)
end

- (Object) unique_attribute_names



46
47
48
# File 'lib/thinking_sphinx/real_time/index.rb', line 46

def unique_attribute_names
  attributes.collect(&:name)
end