Sha256: 48a174b0b489adf8d46c63ff1a65ee4fca20501cca858a960c7badc2e9ee9176

Contents?: true

Size: 623 Bytes

Versions: 14

Compression:

Stored size: 623 Bytes

Contents

# frozen_string_literal: true

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_index_objects = indices
    index
  end

  def grouped_indices
    indices.group_by &:reference
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-5.5.1 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-5.5.0 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-5.4.0 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-5.3.0 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-5.2.1 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-5.2.0 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-5.1.0 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-5.0.0 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-4.4.1 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-4.4.0 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-4.3.2 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-4.3.1 lib/thinking_sphinx/configuration/distributed_indices.rb
thinking-sphinx-4.3.0 lib/thinking_sphinx/configuration/distributed_indices.rb