Method: Elasticsearch::Model::Indexing::ClassMethods#refresh_index!
- Defined in:
- lib/elasticsearch/model/indexing.rb
permalink #refresh_index!(options = {}) ⇒ Object
Performs the “refresh” operation for the index (useful e.g. in tests)
304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/elasticsearch/model/indexing.rb', line 304 def refresh_index!(={}) target_index = .delete(:index) || self.index_name begin self.client.indices.refresh index: target_index rescue Exception => e if e.class.to_s =~ /NotFound/ && [:force] client.transport.logger.debug("[!!!] Index does not exist (#{e.class})") if client.transport.logger nil else raise e end end end |