Method: Elasticsearch::Model::Indexing::ClassMethods#index_exists?
- Defined in:
- lib/elasticsearch/model/indexing.rb
#index_exists?(options = {}) ⇒ Boolean
Returns true if the index exists
261 262 263 264 265 |
# File 'lib/elasticsearch/model/indexing.rb', line 261 def index_exists?(={}) target_index = [:index] || self.index_name self.client.indices.exists(index: target_index, ignore: 404) end |