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