#254 - Index unsupported files

This commit is contained in:
Simon Cambier
2023-07-17 11:49:54 +02:00
parent 6da4a3e785
commit 1a109d6d89
4 changed files with 62 additions and 12 deletions

View File

@@ -12,6 +12,7 @@ import {
isFileCanvas,
isFileFromDataloomPlugin,
isFilePlaintext,
isFilenameIndexable,
logDebug,
makeMD5,
removeDiacritics,
@@ -87,8 +88,11 @@ async function getAndMapIndexedDocument(
// ** Image or PDF **
else if (extractor?.canFileBeExtracted(path)) {
content = await extractor.extractText(file)
} else {
throw new Error(`Unsupported file type: "${path}"`)
}
// ** Unsupported files **
else if (isFilenameIndexable(path)) {
content = file.path
}
if (content === null || content === undefined) {