Class: ThinkingSphinx::Distributed::Index
- Inherits:
-
Riddle::Configuration::DistributedIndex
- Object
- Riddle::Configuration::DistributedIndex
- ThinkingSphinx::Distributed::Index
- Defined in:
- lib/thinking_sphinx/distributed/index.rb
Instance Attribute Summary collapse
-
#local_index_objects ⇒ Object
Returns the value of attribute local_index_objects.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
Instance Method Summary collapse
- #delta? ⇒ Boolean
- #distributed? ⇒ Boolean
- #facets ⇒ Object
-
#initialize(reference) ⇒ Index
constructor
A new instance of Index.
- #model ⇒ Object
- #primary_key ⇒ Object
Constructor Details
#initialize(reference) ⇒ Index
Returns a new instance of Index.
8 9 10 11 12 13 14 |
# File 'lib/thinking_sphinx/distributed/index.rb', line 8 def initialize(reference) @reference = reference @options = {} @local_index_objects = [] super reference.to_s.gsub('/', '_') end |
Instance Attribute Details
#local_index_objects ⇒ Object
Returns the value of attribute local_index_objects.
6 7 8 |
# File 'lib/thinking_sphinx/distributed/index.rb', line 6 def local_index_objects @local_index_objects end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/thinking_sphinx/distributed/index.rb', line 6 def @options end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
6 7 8 |
# File 'lib/thinking_sphinx/distributed/index.rb', line 6 def reference @reference end |
Instance Method Details
#delta? ⇒ Boolean
16 17 18 |
# File 'lib/thinking_sphinx/distributed/index.rb', line 16 def delta? false end |
#distributed? ⇒ Boolean
20 21 22 |
# File 'lib/thinking_sphinx/distributed/index.rb', line 20 def distributed? true end |
#facets ⇒ Object
24 25 26 |
# File 'lib/thinking_sphinx/distributed/index.rb', line 24 def facets local_index_objects.collect(&:facets).flatten end |
#model ⇒ Object
33 34 35 |
# File 'lib/thinking_sphinx/distributed/index.rb', line 33 def model @model ||= reference.to_s.camelize.constantize end |
#primary_key ⇒ Object
37 38 39 |
# File 'lib/thinking_sphinx/distributed/index.rb', line 37 def primary_key @primary_key ||= configuration.settings['primary_key'] || :id end |