Sha256: 1f00b6d3bbb6f521abd868c05e442dfc9bc43a695ddfcc76d1584b7f395e43ce

Contents?: true

Size: 602 Bytes

Versions: 10

Compression:

Stored size: 602 Bytes

Contents

class ThinkingSphinx::Configuration::DistributedIndices
  def initialize(indices)
    @indices = indices
  end

  def reconcile
    grouped_indices.each do |reference, indices|
      append distributed_index(reference, indices)
    end
  end

  private

  attr_reader :indices

  def append(index)
    ThinkingSphinx::Configuration.instance.indices << index
  end

  def distributed_index(reference, indices)
    index = ThinkingSphinx::Distributed::Index.new reference
    index.local_indices += indices.collect &:name
    index
  end

  def grouped_indices
    indices.group_by &:reference
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
thinking-sphinx-3.4.2 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-3.4.1 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-3.4.0 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-3.3.0 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-3.2.0 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-3.1.4 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-3.1.3 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-3.1.2 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-3.1.1 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-3.1.0 lib/thinking_sphinx/configuration/distributed_indices.rb