honkster-acts_as_solr 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/acts_as_solr/tasks/solr.rake +4 -4
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -2,7 +2,7 @@ namespace :solr do
|
|
2
2
|
|
3
3
|
desc 'Starts Solr. Options accepted: RAILS_ENV=your_env, PORT=XX. Defaults to development if none.'
|
4
4
|
task :start do
|
5
|
-
require File.expand_path("#{File.dirname(__FILE__)}
|
5
|
+
require File.expand_path("#{File.dirname(__FILE__)}/../../../config/solr_environment")
|
6
6
|
begin
|
7
7
|
n = Net::HTTP.new('127.0.0.1', SOLR_PORT)
|
8
8
|
n.request_head('/').value
|
@@ -25,7 +25,7 @@ namespace :solr do
|
|
25
25
|
|
26
26
|
desc 'Stops Solr. Specify the environment by using: RAILS_ENV=your_env. Defaults to development if none.'
|
27
27
|
task :stop do
|
28
|
-
require File.expand_path("#{File.dirname(__FILE__)}
|
28
|
+
require File.expand_path("#{File.dirname(__FILE__)}/../../../config/solr_environment")
|
29
29
|
fork do
|
30
30
|
file_path = "#{SOLR_PIDS_PATH}/#{ENV['RAILS_ENV']}_pid"
|
31
31
|
if File.exists?(file_path)
|
@@ -44,7 +44,7 @@ namespace :solr do
|
|
44
44
|
|
45
45
|
desc 'Remove Solr index'
|
46
46
|
task :destroy_index do
|
47
|
-
require File.expand_path("#{File.dirname(__FILE__)}
|
47
|
+
require File.expand_path("#{File.dirname(__FILE__)}/../../../config/solr_environment")
|
48
48
|
raise "In production mode. I'm not going to delete the index, sorry." if ENV['RAILS_ENV'] == "production"
|
49
49
|
if File.exists?("#{SOLR_DATA_PATH}")
|
50
50
|
Dir["#{SOLR_DATA_PATH}/index/*"].each{|f| File.unlink(f)}
|
@@ -57,7 +57,7 @@ namespace :solr do
|
|
57
57
|
# http://henrik.nyh.se/2007/06/rake-task-to-reindex-models-for-acts_as_solr
|
58
58
|
desc %{Reindexes data for all acts_as_solr models. Clears index first to get rid of orphaned records and optimizes index afterwards. RAILS_ENV=your_env to set environment. ONLY=book,person,magazine to only reindex those models; EXCEPT=book,magazine to exclude those models. START_SERVER=true to solr:start before and solr:stop after. BATCH=123 to post/commit in batches of that size: default is 300. CLEAR=false to not clear the index first; OPTIMIZE=false to not optimize the index afterwards.}
|
59
59
|
task :reindex => :environment do
|
60
|
-
require File.expand_path("#{File.dirname(__FILE__)}
|
60
|
+
require File.expand_path("#{File.dirname(__FILE__)}/../../../config/solr_environment")
|
61
61
|
|
62
62
|
includes = env_array_to_constants('ONLY')
|
63
63
|
if includes.empty?
|