#NEWLINE# def index( self , content , document = None , identifier = None , **metadata ) : #NEWLINE# #INDENT# if ( document is None ) : #NEWLINE# #INDENT# document = Document . create ( content = content , identifier = nrows ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# del document . metadata #NEWLINE# nrows = Document . update ( content = content , identifier = identifier ) . where ( ( Document . _meta . primary_key == document . get_id ( ) ) ) . execute ( ) #NEWLINE# #UNINDENT# self . add_to_index ( document ) #NEWLINE# if metadata : #NEWLINE# #INDENT# document . metadata = metadata #NEWLINE# #UNINDENT# return document