fix(core): fix table text content search (#10488)

This commit is contained in:
EYHN
2025-03-05 04:06:43 +00:00
parent e99b25ae6a
commit 4daa763c95
2 changed files with 15 additions and 5 deletions

View File

@@ -32,7 +32,7 @@ export class DocsIndexer extends Entity {
/**
* increase this number to re-index all docs
*/
static INDEXER_VERSION = 18;
static INDEXER_VERSION = 19;
private readonly jobQueue: JobQueue<IndexerJobPayload> =
new IndexedDBJobQueue<IndexerJobPayload>(

View File

@@ -821,10 +821,20 @@ async function crawlingDocData({
...commonBlockProps,
content: block.get('prop:latex')?.toString() ?? '',
});
} else if (
bookmarkFlavours.has(flavour) ||
flavour === TableModelFlavour
) {
} else if (flavour === TableModelFlavour) {
const contents = Array.from<string>(block.keys())
.map(key => {
if (key.startsWith('prop:cells.') && key.endsWith('.text')) {
return block.get(key)?.toString() ?? '';
}
return '';
})
.filter(Boolean);
blockDocuments.push({
...commonBlockProps,
content: contents,
});
} else if (bookmarkFlavours.has(flavour)) {
blockDocuments.push({
...commonBlockProps,
});