lib/elasticsearch/model/indexing.rb in elasticsearch-model-7.1.1 vs lib/elasticsearch/model/indexing.rb in elasticsearch-model-7.1.2.pre
- old
+ new
@@ -268,10 +268,10 @@
# Article.__elasticsearch__.index_exists? index: 'my-index'
#
def index_exists?(options={})
target_index = options[:index] || self.index_name
- self.client.indices.exists(index: target_index) rescue false
+ self.client.indices.exists(index: target_index, ignore: 404)
end
# Deletes the index with corresponding name
#
# @example Delete the index for the `Article` model