Method: Mebla::Context#drop_index

Defined in:
lib/mebla/context.rb

#drop_indexBoolean

Deletes the index of the document

Returns:

  • (Boolean)

    true if operation is successful



60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/mebla/context.rb', line 60

def drop_index
  # Only drop the index if it exists
  return true unless index_exists?
  
  Mebla.log("Dropping index: #{self.slingshot_index_name}", :debug)
  
  # Drop the index
  result = @slingshot_index.delete
  
  Mebla.log("Dropped #{self.slingshot_index_name}: #{result.to_s}", :debug)
  
  # Check that the index doesn't exist
  !index_exists?
end