Reindex tweaks
parent
59ab0cbaff
commit
f3a252b5dc
|
@ -10,15 +10,16 @@ export async function reindexCommand() {
|
||||||
await editor.flashNotification("Done with page index!");
|
await editor.flashNotification("Done with page index!");
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function reindexSpace() {
|
export async function reindexSpace(noClear = false) {
|
||||||
if (await system.getMode() === "ro") {
|
if (await system.getMode() === "ro") {
|
||||||
console.info("Not reindexing because we're in read-only mode");
|
console.info("Not reindexing because we're in read-only mode");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log("Clearing page index...");
|
if (!noClear) {
|
||||||
// Executed this way to not have to embed the search plug code here
|
console.log("Clearing page index...");
|
||||||
await system.invokeFunction("index.clearIndex");
|
// Executed this way to not have to embed the search plug code here
|
||||||
|
await system.invokeFunction("index.clearIndex");
|
||||||
|
}
|
||||||
// Load builtins
|
// Load builtins
|
||||||
await system.invokeFunction("index.loadBuiltinsIntoIndex");
|
await system.invokeFunction("index.loadBuiltinsIntoIndex");
|
||||||
|
|
||||||
|
|
|
@ -274,10 +274,14 @@ export class Client {
|
||||||
console.error,
|
console.error,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// This was the initial sync, let's mark a full index as completed
|
// Let's load space scripts, which probably weren't loaded before
|
||||||
await markFullSpaceIndexComplete(this.stateDataStore);
|
|
||||||
// And load space scripts, which probably weren't loaded before
|
|
||||||
await this.clientSystem.loadSpaceScripts();
|
await this.clientSystem.loadSpaceScripts();
|
||||||
|
console.log(
|
||||||
|
"Initial sync completed, now need to do a full space index to ensure all pages are indexed using any custom space script indexers",
|
||||||
|
);
|
||||||
|
ensureSpaceIndex(this.stateDataStore, this.clientSystem.system).catch(
|
||||||
|
console.error,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (operations) {
|
if (operations) {
|
||||||
|
|
Loading…
Reference in New Issue