class ThinkingSphinx::Configuration::DistributedIndices

Attributes

indices[R]

Public Class Methods

new(indices) click to toggle source
# File lib/thinking_sphinx/configuration/distributed_indices.rb, line 4
def initialize(indices)
  @indices = indices
end

Public Instance Methods

reconcile() click to toggle source
# File lib/thinking_sphinx/configuration/distributed_indices.rb, line 8
def reconcile
  grouped_indices.each do |reference, indices|
    append distributed_index(reference, indices)
  end
end

Private Instance Methods

append(index) click to toggle source
# File lib/thinking_sphinx/configuration/distributed_indices.rb, line 18
def append(index)
  ThinkingSphinx::Configuration.instance.indices << index
end
distributed_index(reference, indices) click to toggle source
# File lib/thinking_sphinx/configuration/distributed_indices.rb, line 22
def distributed_index(reference, indices)
  index = ThinkingSphinx::Distributed::Index.new reference
  index.local_index_objects = indices
  index
end
grouped_indices() click to toggle source
# File lib/thinking_sphinx/configuration/distributed_indices.rb, line 28
def grouped_indices
  indices.group_by &:reference
end