Skip to content

Commit

Permalink
Adding rebuild rake task, from a patch provided by Anderson Dias.
Browse files Browse the repository at this point in the history
  • Loading branch information
pat committed May 23, 2009
1 parent 4ea6019 commit 158a202
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.textile
Expand Up @@ -127,3 +127,4 @@ Since I first released this library, there's been quite a few people who have su
* Mike Bailey
* Bill Leeper
* Michael Reinsch
* Anderson Dias
9 changes: 9 additions & 0 deletions lib/thinking_sphinx/tasks.rb
Expand Up @@ -75,6 +75,13 @@
system cmd
end

desc "Stop Sphinx (if it's running), rebuild the indexes, and start Sphinx"
task :rebuild => :app_env do
Rake::Task["thinking_sphinx:stop"].invoke if sphinx_running?
Rake::Task["thinking_sphinx:index"].invoke
Rake::Task["thinking_sphinx:start"].invoke
end

namespace :index do
task :delta => :app_env do
ThinkingSphinx.indexed_models.select { |model|
Expand Down Expand Up @@ -122,6 +129,8 @@
task :conf => "thinking_sphinx:configure"
desc "Generate the Sphinx configuration file using Thinking Sphinx's settings"
task :config => "thinking_sphinx:configure"
desc "Stop Sphinx (if it's running), rebuild the indexes, and start Sphinx"
task :rebuild => "thinking_sphinx:rebuild"
desc "Process stored delta index requests"
task :dd => "thinking_sphinx:delayed_delta"
end
Expand Down

0 comments on commit 158a202

Please sign in to comment.