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 2
def initialize(indices)
  @indices = indices
end

Public Instance Methods

reconcile() click to toggle source
# File lib/thinking_sphinx/configuration/distributed_indices.rb, line 6
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 16
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 20
def distributed_index(reference, indices)
  index = ThinkingSphinx::Distributed::Index.new reference
  index.local_indices += indices.collect &:name
  index
end
grouped_indices() click to toggle source
# File lib/thinking_sphinx/configuration/distributed_indices.rb, line 26
def grouped_indices
  indices.group_by &:reference
end