elastics-admin 1.1.2 → 1.1.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.
- data/VERSION +1 -1
- data/lib/elastics/admin_live_reindex.rb +15 -9
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.3
|
@@ -159,6 +159,21 @@ module Elastics
|
|
159
159
|
# try to empty the changes for 10 times before stopping the indexing
|
160
160
|
10.times{ index_changes(opts) }
|
161
161
|
|
162
|
+
# optimizing indices
|
163
|
+
if Conf.optimize_indexing
|
164
|
+
@indices.each do |index|
|
165
|
+
prefixed = @prefix + index
|
166
|
+
Prompter.say_notice "Optimizing index #{prefixed}..." if opts[:verbose]
|
167
|
+
# reset the refresh_interval
|
168
|
+
Elastics.put_index_settings(:index => prefixed,
|
169
|
+
:data => {:index => {:refresh_interval => (@refresh_intervals[index] || '1s')}})
|
170
|
+
# optimize the index
|
171
|
+
Elastics.optimize_index(:index => prefixed,
|
172
|
+
:params => {:max_num_segments => 5})
|
173
|
+
end
|
174
|
+
index_changes(opts)
|
175
|
+
end
|
176
|
+
|
162
177
|
# at this point the changes list should be empty or contain the minimum number of changes we could achieve live
|
163
178
|
# the @stop_indexing should ensure to stop/suspend all the actions that would produce changes in the indices being reindexed
|
164
179
|
if @stop_indexing
|
@@ -175,15 +190,6 @@ module Elastics
|
|
175
190
|
# deletes the old indices and create the aliases to the new
|
176
191
|
@indices.each do |index|
|
177
192
|
prefixed = @prefix + index
|
178
|
-
if Conf.optimize_indexing
|
179
|
-
Prompter.say_notice "Optimizing index #{prefixed}..." if opts[:verbose]
|
180
|
-
# reset the refresh_interval
|
181
|
-
Elastics.put_index_settings(:index => prefixed,
|
182
|
-
:data => {:index => {:refresh_interval => (@refresh_intervals[index] || '1s')}})
|
183
|
-
# optimize the index
|
184
|
-
Elastics.optimize_index(:index => prefixed,
|
185
|
-
:params => {:max_num_segments => 5})
|
186
|
-
end
|
187
193
|
Prompter.say_notice "Swapping to index #{prefixed}..." if opts[:verbose]
|
188
194
|
Elastics.delete_index :index => index,
|
189
195
|
:raise => false # may not exist
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastics-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.1.
|
21
|
+
version: 1.1.3
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.1.
|
29
|
+
version: 1.1.3
|
30
30
|
description: Provides binary and rake tasks to dump, load and optionally rename indices.
|
31
31
|
Implements live-reindex with hot-swap of old code/index with new code/index.
|
32
32
|
email: dd.nexus@gmail.com
|