<commit_before>namespace :load do
  task :defaults do
    set :thinking_sphinx_roles, :db
  end
end

namespace :thinking_sphinx do
  desc <<-DESC
Stop, reindex, and then start the Sphinx search daemon. This task must be executed \
if you alter the structure of your indexes.
  DESC
  task :rebuild do
    on roles fetch(:thinking_sphinx_roles) do
      within current_path do
        with rails_env: fetch(:stage) do
          execute :rake, "ts:rebuild"
        end
      end
    end
  end

  desc 'Stop Sphinx, clear Sphinx index files, generate configuration file, start Sphinx, repopulate all data.'
  task :regenerate do
    on roles fetch(:thinking_sphinx_options) do
      within current_path do
        with rails_env: fetch(:stage) do
          execute :rake, 'ts:regenerate'
        end
      end
    end
  end

  desc 'Build Sphinx indexes into the shared path.'
  task :index do
    on roles fetch(:thinking_sphinx_roles) do
      within current_path do
        with rails_env: fetch(:stage) do
          execute :rake, 'ts:index'
        end
      end
    end
  end

  desc 'Generate Sphinx indexes into the shared path.'
  task :generate do
    on roles fetch(:thinking_sphinx_options) do
      within current_path do
        with rails_env: fetch(:stage) do
          execute :rake, 'ts:generate'
        end
      end
    end
  end

  desc 'Restart the Sphinx search daemon.'
  task :restart do
    on roles fetch(:thinking_sphinx_roles) do
      within current_path do
        with rails_env: fetch(:stage) do
          %w(stop configure start).each do |task|
            execute :rake, "ts:#{task}"
          end
        end
      end
    end
  end

  desc 'Start the Sphinx search daemon.'
  task :start do
    on roles fetch(:thinking_sphinx_roles) do
      within current_path do
        with rails_env: fetch(:stage) do<commit_msg>Real-time tasks for Cap v3 now refer to thinking_sphinx_roles.<commit_after>namespace :load do
  task :defaults do
    set :thinking_sphinx_roles, :db
  end
end

namespace :thinking_sphinx do
  desc <<-DESC
Stop, reindex, and then start the Sphinx search daemon. This task must be executed \
if you alter the structure of your indexes.
  DESC
  task :rebuild do
    on roles fetch(:thinking_sphinx_roles) do
      within current_path do
        with rails_env: fetch(:stage) do
          execute :rake, "ts:rebuild"
        end
      end
    end
  end

  desc 'Stop Sphinx, clear Sphinx index files, generate configuration file, start Sphinx, repopulate all data.'
  task :regenerate do
    on roles fetch(:thinking_sphinx_roles) do
      within current_path do
        with rails_env: fetch(:stage) do
          execute :rake, 'ts:regenerate'
        end
      end
    end
  end

  desc 'Build Sphinx indexes into the shared path.'
  task :index do
    on roles fetch(:thinking_sphinx_roles) do
      within current_path do
        with rails_env: fetch(:stage) do
          execute :rake, 'ts:index'
        end
      end
    end
  end

  desc 'Generate Sphinx indexes into the shared path.'
  task :generate do
    on roles fetch(:thinking_sphinx_roles) do
      within current_path do
        with rails_env: fetch(:stage) do
          execute :rake, 'ts:generate'
        end
      end
    end
  end

  desc 'Restart the Sphinx search daemon.'
  task :restart do
    on roles fetch(:thinking_sphinx_roles) do
      within current_path do
        with rails_env: fetch(:stage) do
          %w(stop configure start).each do |task|
            execute :rake, "ts:#{task}"
          end
        end
      end
    end
  end

  desc 'Start the Sphinx search daemon.'
  task :start do
    on roles fetch(:thinking_sphinx_roles) do
      within current_path do
        with rails_env: fetch(:stage) do
{'fraction_non_alphanumeric': 0.06344974673420421, 'fraction_numerical': 0.00026659557451346307, 'mean_word_length': 2.458064516129032, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3729843', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1136, 'n_words': 421}