mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
Revert "feat: improve indexing performance"
This reverts commit 0c7f058051.
This commit is contained in:
@@ -7,18 +7,16 @@ import IndexedCollection from "./indexed-collection";
|
||||
|
||||
export default class CachedCollection extends IndexedCollection {
|
||||
async init() {
|
||||
const store = new PersistentCachedMap(this.storeKey, this.storage);
|
||||
const index = new PersistentCachedMap(`${this.type}Index`, this.storage);
|
||||
const store = new PersistentCachedMap(`${this.type}Store`, this.storage);
|
||||
await index.init();
|
||||
await store.init();
|
||||
this.search = new HyperSearch({
|
||||
schema: getSchema(this.type),
|
||||
tokenizer: "forward",
|
||||
index,
|
||||
store,
|
||||
onIndexUpdated: async () => {
|
||||
await this.storage.write(this.indexKey, this.search.indexer.export());
|
||||
},
|
||||
});
|
||||
const index = await this.storage.read(this.indexKey);
|
||||
this.search.indexer.import(index);
|
||||
}
|
||||
|
||||
exists(id) {
|
||||
|
||||
Reference in New Issue
Block a user