Sha256: 5720c35e745f677417d4fa679c1cbc694ebe06be33a931a540e3fa0a837d66e2

Contents?: true

Size: 551 Bytes

Versions: 17

Compression:

Stored size: 551 Bytes

Contents

# frozen_string_literal: true

class ThinkingSphinx::Commands::Merge < ThinkingSphinx::Commands::Base
  def call
    return unless indices_exist?

    controller.merge(
      options[:core_index].name,
      options[:delta_index].name,
      :filters => options[:filters],
      :verbose => options[:verbose]
    )
  end

  private

  delegate :controller, :to => :configuration

  def indices_exist?
    File.exist?("#{options[:core_index].path}.spi") &&
    File.exist?("#{options[:delta_index].path}.spi")
  end

  def type
    'merging'
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-5.5.1 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-5.5.0 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-5.4.0 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-5.3.0 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-5.2.1 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-5.2.0 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-5.1.0 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-5.0.0 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-4.4.1 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-4.4.0 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-4.3.2 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-4.3.1 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-4.3.0 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-4.2.0 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-4.1.0 lib/thinking_sphinx/commands/merge.rb
thinking-sphinx-4.0.0 lib/thinking_sphinx/commands/merge.rb