Class: ThinkingSphinx::RealTime::Index
- Inherits:
-
Riddle::Configuration::RealtimeIndex
- Object
- Riddle::Configuration::RealtimeIndex
- ThinkingSphinx::RealTime::Index
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
#delta?, #distributed?, #document_id_for_key, #interpret_definition!, #model, #options, #render
Constructor Details
#initialize(reference, options = {}) ⇒ Index
Returns a new instance of Index
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
#attributes ⇒ Object
24
25
26
27
28
|
# File 'lib/thinking_sphinx/real_time/index.rb', line 24
def attributes
interpret_definition!
@attributes
end
|
#conditions ⇒ Object
30
31
32
33
34
|
# File 'lib/thinking_sphinx/real_time/index.rb', line 30
def conditions
interpret_definition!
@conditions
end
|
#fields ⇒ Object
40
41
42
43
44
|
# File 'lib/thinking_sphinx/real_time/index.rb', line 40
def fields
interpret_definition!
@fields
end
|
#scope ⇒ Object
46
47
48
|
# File 'lib/thinking_sphinx/real_time/index.rb', line 46
def scope
@scope.nil? ? model : @scope.call
end
|
Instance Method Details
#add_attribute(attribute) ⇒ Object
16
17
18
|
# File 'lib/thinking_sphinx/real_time/index.rb', line 16
def add_attribute(attribute)
@attributes << attribute
end
|
#add_field(field) ⇒ Object
20
21
22
|
# File 'lib/thinking_sphinx/real_time/index.rb', line 20
def add_field(field)
@fields << field
end
|
#facets ⇒ Object
36
37
38
|
# File 'lib/thinking_sphinx/real_time/index.rb', line 36
def facets
properties.select(&:facet?)
end
|
#unique_attribute_names ⇒ Object
50
51
52
|
# File 'lib/thinking_sphinx/real_time/index.rb', line 50
def unique_attribute_names
attributes.collect(&:name)
end
|