elasticsearch-indexstager 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e73491d3ba2e305ab074aed57062767b46c29d8
4
- data.tar.gz: 3595bc3ba4fcf7f4901a6cac98c94dd5c843cea5
3
+ metadata.gz: f954192233eea6e297161b49618399bdae9978bc
4
+ data.tar.gz: 3dea1ca8fc2a5dff4998c48f04fb6eb2463aba75
5
5
  SHA512:
6
- metadata.gz: 9de82f1bc5a545de2a13af08a4330745e504c7f3207f85a538d584a2056f174a39c4c32d9f96faffad9901113c64494c667c73f29ecdf517439ed6c35908de67
7
- data.tar.gz: 44df44aa561454f8f94cd96cfbf1d17248a85771ec4ece88441ea799ae90b5e22463b932f919862cb5ca1775ce44dc94f958899bbce159a3d34b2fd5294de8c2
6
+ metadata.gz: d25461f034f8ee24c139b791267fc04a6899cbd80c9a7743bb60799082a581747041e575d7d910b3ea5ec33a2f8ee09a3709c504db413c752fa8085916b804ad
7
+ data.tar.gz: d3d235eff05326dbee6f0beb615716cfb77a0d857d211be1a5e429bb95bf1d28b49c6bba16c124dd19e92a66f8e8866a9789bbaabb1d22de4f4faa2ef7fb90b9
@@ -2,7 +2,7 @@ require 'securerandom'
2
2
 
3
3
  module Elasticsearch
4
4
  class IndexStager
5
- VERSION = '1.1.2'
5
+ VERSION = '1.1.3'
6
6
 
7
7
  attr_reader :index_name, :es_client
8
8
 
@@ -80,6 +80,7 @@ module Elasticsearch
80
80
  def rename_live_index
81
81
  # if the live index exists but is empty, it fill fail to reindex (rename)
82
82
  # so catch that case and just delete it.
83
+ es_client.indices.refresh index: @live_index_name rescue false
83
84
  idx_stats = es_client.indices.stats index: @live_index_name, docs: true
84
85
  num_docs = idx_stats['indices'][@live_index_name]['total']['docs']['count']
85
86
  if num_docs.to_i == 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-indexstager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Karman
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: elasticsearch-extensions
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '6.0'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '6.0'
82
+ version: '0'
83
83
  description: manage Elasticsearch indexes using staging pattern
84
84
  email:
85
85
  - karpet@peknet.com