#NEWLINE# def create_index( self ) : #NEWLINE# #INDENT# '\n        Creats the whoosh index. Delets an existing index if exists.\n\n        Returns the index.\n        ' #NEWLINE# path = self . get_index_path ( ) #NEWLINE# if ( path == 'ram' ) : #NEWLINE# #INDENT# self . storage = RamStorage ( ) . create_index ( get_schema ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if os . path . exists ( path ) : #NEWLINE# #INDENT# shutil . rmtree ( path ) #NEWLINE# #UNINDENT# os . mkdir ( path ) #NEWLINE# self . storage = create_in ( self , get_schema ( ) ) #NEWLINE# #UNINDENT# return self . storage