Method: Mebla::Context#rebuild_index

Defined in:
lib/mebla/context.rb

#rebuild_indexnil

Note:

Doesn’t index the data, use Mebla::Context#reindex_data to rebuild the index and index the data

Deletes and rebuilds the index

Returns:

  • (nil)

Raises:



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/mebla/context.rb', line 32

def rebuild_index
  # Only rebuild if the index exists
  raise Mebla::Errors::MeblaIndexException.new("#{@slingshot_index_name} does not exist !! use #create_index to create the index first.") unless index_exists?

  Mebla.log("Rebuilding index")      
  
  # Delete the index
  if drop_index
    # Create the index
    return build_index
  end
end