sunspot-parallel-reindex 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/sunspot/parallel/reindex/version.rb +1 -1
- data/lib/sunspot/rails/searchable/acts_as_methods.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01ee25152c5d8911ba792d0cf9b3d9376c2f615e
|
4
|
+
data.tar.gz: 7847a988fb8972f002478dfcd987b43e35bcc62b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea323d3d8bef5e729c661a3d2ddfad6a08593baa16d5b550fb18c4e7226d808ac6f9261152ece00d0411476940f0636fedbcc20eeab6088516aedec129fdebdc
|
7
|
+
data.tar.gz: fb6125a66563ac6dcd6f31847b5c73152882468e0f08687500325d1a652a6e5adf8cd9c32fda8c69adf9ef2046880e427dfb73cda47fc1f2836695b474974a65
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ Parameters are all optional, just like `rake sunspot:reindex`
|
|
26
26
|
|
27
27
|
## Contributing
|
28
28
|
|
29
|
-
1. Fork it ( https://github.com/
|
29
|
+
1. Fork it ( https://github.com/btucker/sunspot-parallel-reindex/fork )
|
30
30
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
31
31
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
32
32
|
4. Push to the branch (`git push origin my-new-feature`)
|
@@ -1,9 +1,10 @@
|
|
1
|
+
require 'parallel'
|
2
|
+
|
1
3
|
module Sunspot
|
2
4
|
module Rails
|
3
5
|
module Searchable
|
4
6
|
module ActsAsMethods
|
5
7
|
def solr_index_parallel(opts={})
|
6
|
-
require 'parallel'
|
7
8
|
|
8
9
|
options = {
|
9
10
|
:batch_size => Sunspot.config.indexing.default_batch_size,
|
@@ -28,7 +29,7 @@ module Sunspot
|
|
28
29
|
batch_counter = 0
|
29
30
|
self.includes(options[:include]).find_in_batches(find_in_batch_options) do |records|
|
30
31
|
::ActiveRecord::Base.establish_connection
|
31
|
-
Parallel.each(records.in_groups(exec_processor_size),
|
32
|
+
::Parallel.each(records.in_groups(exec_processor_size),
|
32
33
|
in_processes: exec_processor_size,
|
33
34
|
finish: progress_lambda) do |batch|
|
34
35
|
::ActiveRecord::Base.establish_connection
|