mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-17 14:27:02 +08:00
fix(core): indexer data loss (#9216)
This commit is contained in:
@@ -143,12 +143,15 @@ export class DataStruct {
|
||||
|
||||
if (nid) {
|
||||
await trx.objectStore('records').delete(nid);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
const indexIds = await trx
|
||||
.objectStore('invertedIndex')
|
||||
.index('nid')
|
||||
.getAllKeys(nid);
|
||||
|
||||
for (const indexId of indexIds) {
|
||||
await trx.objectStore('invertedIndex').delete(indexId);
|
||||
}
|
||||
@@ -266,6 +269,8 @@ export class DataStruct {
|
||||
nodes.push(this.resultNode(record, options, match, nid));
|
||||
}
|
||||
|
||||
console.log(nodes);
|
||||
|
||||
return {
|
||||
pagination: {
|
||||
count: match.size(),
|
||||
|
||||
@@ -36,7 +36,7 @@ export class DocsIndexer extends Entity {
|
||||
/**
|
||||
* increase this number to re-index all docs
|
||||
*/
|
||||
static INDEXER_VERSION = 11;
|
||||
static INDEXER_VERSION = 17;
|
||||
|
||||
private readonly jobQueue: JobQueue<IndexerJobPayload> =
|
||||
new IndexedDBJobQueue<IndexerJobPayload>(
|
||||
|
||||
Reference in New Issue
Block a user