@gensim.utils.synchronous('<STR_LIT>')<EOL><INDENT>def drop_index(self, keep_model=True):<DEDENT>
modelstr = "<STR_LIT>" if keep_model else "<STR_LIT>"<EOL>logger.info("<STR_LIT>" + modelstr + "<STR_LIT>" % self.basename)<EOL>for index in [self.fresh_index, self.opt_index]:<EOL><INDENT>if index is not None:<EOL><INDENT>index.terminate()<EOL><DEDENT><DEDENT>self.fresh_index, self.opt_index = None, None<EOL>if self.payload is not None:<EOL><INDENT>self.payload.close()<EOL>fname = self.location('<STR_LIT>')<EOL>try:<EOL><INDENT>if os.path.exists(fname):<EOL><INDENT>os.remove(fname)<EOL>logger.info("<STR_LIT>" % fname)<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>logger.warning("<STR_LIT>" % fname)<EOL><DEDENT><DEDENT>self.payload = SqliteDict(self.location('<STR_LIT>'), autocommit=True, journal_mode=JOURNAL_MODE)<EOL>if not keep_model and self.model is not None:<EOL><INDENT>self.model.close()<EOL>fname = self.location('<STR_LIT>')<EOL>try:<EOL><INDENT>if os.path.exists(fname):<EOL><INDENT>os.remove(fname)<EOL>logger.info("<STR_LIT>" % fname)<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>logger.warning("<STR_LIT>" % fname)<EOL><DEDENT>self.model = None<EOL><DEDENT>self.flush(save_index=True, save_model=True, clear_buffer=True)<EOL>
Drop all indexed documents. If `keep_model` is False, also dropped the model.