separate mention category for employees (#5095)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov
2024-03-29 18:37:36 +05:00
committed by GitHub
parent 16204edaac
commit 72a93ad388
13 changed files with 56 additions and 52 deletions
+10 -7
View File
@@ -114,16 +114,19 @@ export class FullTextIndex implements WithFind {
const old = stDocs.get(cud.objectId as Ref<DocIndexState>)
if (cud._class === core.class.TxRemoveDoc && old?.create !== undefined) {
// Object created and deleted, skip index
stDocs.delete(cud.objectId as Ref<DocIndexState>)
continue
} else if (old !== undefined) {
// Create and update
// Skip update
continue
if (old.removed) continue
else {
stDocs.set(cud.objectId as Ref<DocIndexState>, {
...old,
updated: cud._class !== core.class.TxRemoveDoc,
removed: cud._class === core.class.TxRemoveDoc
})
}
}
stDocs.set(cud.objectId as Ref<DocIndexState>, {
updated: cud._class !== core.class.TxRemoveDoc,
removed: cud._class === core.class.TxRemoveDoc
})
}
}
}
@@ -207,7 +210,7 @@ export class FullTextIndex implements WithFind {
const indexedDocMap = new Map<Ref<Doc>, IndexedDoc>()
for (const doc of docs) {
if (this.hierarchy.isDerived(doc._class, baseClass)) {
if (doc._class.some((cl) => this.hierarchy.isDerived(cl, baseClass))) {
ids.add(doc.id)
indexedDocMap.set(doc.id, doc)
}