Class: ThinkingSphinx::ActiveRecord::Index
- Inherits:
-
Riddle::Configuration::Index
- Object
- Riddle::Configuration::Index
- ThinkingSphinx::ActiveRecord::Index
show all
- Includes:
- Core::Index
- Defined in:
- lib/thinking_sphinx/active_record/index.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#distributed?, #document_id_for_instance, #document_id_for_key, #initialize, #interpret_definition!, #model, #options, #primary_key, #render
Instance Attribute Details
#definition_block=(value) ⇒ Object
Sets the attribute definition_block
7
8
9
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 7
def definition_block=(value)
@definition_block = value
end
|
#reference ⇒ Object
Returns the value of attribute reference.
6
7
8
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 6
def reference
@reference
end
|
Instance Method Details
#append_source ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 9
def append_source
ThinkingSphinx::ActiveRecord::SQLSource.new(
model, source_options.merge(:position => sources.length)
).tap do |source|
sources << source
end
end
|
#attributes ⇒ Object
17
18
19
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 17
def attributes
sources.collect(&:attributes).flatten
end
|
#delta? ⇒ Boolean
21
22
23
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 21
def delta?
@options[:delta?]
end
|
#delta_processor ⇒ Object
25
26
27
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 25
def delta_processor
@options[:delta_processor].try(:new, adapter, @options[:delta_options] || {})
end
|
#facets ⇒ Object
29
30
31
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 29
def facets
@facets ||= sources.collect(&:facets).flatten
end
|
#fields ⇒ Object
33
34
35
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 33
def fields
sources.collect(&:fields).flatten
end
|
#sources ⇒ Object
37
38
39
40
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 37
def sources
interpret_definition!
super
end
|
#unique_attribute_names ⇒ Object
42
43
44
|
# File 'lib/thinking_sphinx/active_record/index.rb', line 42
def unique_attribute_names
attributes.collect(&:name)
end
|