def commit_toc(self, storage, indexname, schema, segments, generation, clean=True): toc = TOC(schema, segments, generation) toc.write(storage, indexname) # Delete leftover files if clean: clean_files(storage, indexname, generation, segments)
def create_index(storage, schema, indexname): from whoosh.filedb.fileindex import TOC, FileIndex if storage.readonly: raise ReadOnlyError TOC.create(storage, schema, indexname) return FileIndex(storage, schema, indexname)
def create_index(self, schema, indexname=_DEF_INDEX_NAME): from whoosh.filedb.fileindex import TOC, FileIndex if self.readonly: raise ReadOnlyError TOC.create(self, schema, indexname) return FileIndex(self, schema, indexname)
def create_index(self, schema, indexname=_DEF_INDEX_NAME): if self.readonly: raise ReadOnlyError TOC.create(self, schema, indexname) return FileIndex(self, schema, indexname)