fix(core): disable blocksuite indexer (#7813)

This commit is contained in:
EYHN
2024-08-09 08:24:44 +00:00
parent 3ad5170b71
commit d2b0ee40a8
7 changed files with 23 additions and 2 deletions

View File

@@ -34,6 +34,8 @@ export class Workspace extends Entity {
}, },
idGenerator: () => nanoid(), idGenerator: () => nanoid(),
schema: globalBlockSuiteSchema, schema: globalBlockSuiteSchema,
disableBacklinkIndex: true,
disableSearchIndex: true,
}); });
} }
return this._docCollection; return this._docCollection;

View File

@@ -61,6 +61,8 @@ export class TestingWorkspaceLocalProvider
blobSources: { blobSources: {
main: blobStorage, main: blobStorage,
}, },
disableBacklinkIndex: true,
disableSearchIndex: true,
}); });
// apply initial state // apply initial state
@@ -95,6 +97,8 @@ export class TestingWorkspaceLocalProvider
const bs = new DocCollection({ const bs = new DocCollection({
id, id,
schema: globalBlockSuiteSchema, schema: globalBlockSuiteSchema,
disableBacklinkIndex: true,
disableSearchIndex: true,
}); });
applyUpdate(bs.doc, data); applyUpdate(bs.doc, data);

View File

@@ -213,7 +213,12 @@ export class AISlidesRenderer extends WithDisposable(LitElement) {
super.connectedCallback(); super.connectedCallback();
const schema = new Schema().register(AffineSchemas); const schema = new Schema().register(AffineSchemas);
const collection = new DocCollection({ schema, id: 'SLIDES_PREVIEW' }); const collection = new DocCollection({
schema,
id: 'SLIDES_PREVIEW',
disableBacklinkIndex: true,
disableSearchIndex: true,
});
collection.meta.initialize(); collection.meta.initialize();
collection.start(); collection.start();
const doc = collection.createDoc(); const doc = collection.createDoc();

View File

@@ -187,7 +187,11 @@ export async function replaceFromMarkdown(
export async function markDownToDoc(host: EditorHost, answer: string) { export async function markDownToDoc(host: EditorHost, answer: string) {
const schema = host.std.doc.collection.schema; const schema = host.std.doc.collection.schema;
// Should not create a new doc in the original collection // Should not create a new doc in the original collection
const collection = new DocCollection({ schema }); const collection = new DocCollection({
schema,
disableBacklinkIndex: true,
disableSearchIndex: true,
});
collection.meta.initialize(); collection.meta.initialize();
const job = new Job({ const job = new Job({
collection, collection,

View File

@@ -109,6 +109,8 @@ const getOrCreateShellWorkspace = (workspaceId: string) => {
main: blobStorage, main: blobStorage,
}, },
schema: globalBlockSuiteSchema, schema: globalBlockSuiteSchema,
disableBacklinkIndex: true,
disableSearchIndex: true,
}); });
docCollectionMap.set(workspaceId, docCollection); docCollectionMap.set(workspaceId, docCollection);
docCollection.doc.emit('sync', [true, docCollection.doc]); docCollection.doc.emit('sync', [true, docCollection.doc]);

View File

@@ -100,6 +100,8 @@ export class CloudWorkspaceFlavourProviderService
blobSources: { blobSources: {
main: blobStorage, main: blobStorage,
}, },
disableBacklinkIndex: true,
disableSearchIndex: true,
}); });
// apply initial state // apply initial state

View File

@@ -72,6 +72,8 @@ export class LocalWorkspaceFlavourProvider
idGenerator: () => nanoid(), idGenerator: () => nanoid(),
schema: globalBlockSuiteSchema, schema: globalBlockSuiteSchema,
blobSources: { main: blobStorage }, blobSources: { main: blobStorage },
disableBacklinkIndex: true,
disableSearchIndex: true,
}); });
// apply initial state // apply initial state