lib/desi/index_manager.rb
def delete!(pattern)
      warn "You must provide a pattern" and exit if pattern.nil?

      @outputter.puts "The following indices from host #{@host} are now deleted" if @verbose

      indices(Regexp.new(pattern)).each do |index|
        @client.delete("/#{index}")
        @outputter.puts " * #{index.inspect}" if @verbose
      end
    end
# Delete all indices matching the specified pattern
#
# @param   [#to_s]          pattern  Regexp pattern used to restrict the selection
# @return  [void]
#
# @note No confirmation is needed, so beware!
#
# @note This method will also output its result on STDOUT if +@verbose+ is
#       true
#
# @example Delete all indices whose name begins with "test"
#    Desi::IndexManager.new.delete!('^test') #=> nil
#
# @api  public
Delete all indices matching the specified pattern
Delete all indices matching the specified pattern
def delete!(pattern)
      warn "You must provide a pattern" and exit if pattern.nil?
      @outputter.puts "The following indices from host #{@host} are now deleted" if @verbose
      indices(Regexp.new(pattern)).each do |index|
        @client.delete("/#{index}")
        @outputter.puts " * #{index.inspect}" if @verbose
      end
    end
def delete! ( pattern ) warn "You must provide a pattern" and exit if pattern . nil? @outputter . puts "The following indices from host #{@host} are now deleted" if @verbose indices ( Regexp . new ( pattern ) ) . each do | index | @client . delete ( "/#{index}" ) @outputter . puts " * #{index.inspect}" if @verbose end end
Delete all indices matching the specified pattern
Delete all indices matching the specified pattern
None
void
pattern
pattern Regexp pattern used to restrict the selection
pattern Regexp pattern used to restrict the selection
note
No confirmation is needed, so beware!
No confirmation is needed so beware!
note
This method will also output its result on STDOUT if +@verbose+ is true
This method will also output its result on STDOUT if + @verbose + is true
example
Delete all indices whose name begins with "test" Desi::IndexManager.new.delete!('^test') #=> nil
Delete all indices whose name begins with " test " Desi :: IndexManager . new . delete! ( ' ^test ' ) # = > nil
api
None