diff --git a/packages/indexer/src/lib/document-processor.ts b/packages/indexer/src/lib/document-processor.ts index 074b31a9..c867c94b 100644 --- a/packages/indexer/src/lib/document-processor.ts +++ b/packages/indexer/src/lib/document-processor.ts @@ -75,6 +75,10 @@ export class DocumentProcessor { let start = 0; let end = length; + if (end <= MAX_SECTION_LENGTH) { + return [{ content: allText, page: findPage(0) }]; + } + while (start + SECTION_OVERLAP < length) { let lastWord = -1; end = start + MAX_SECTION_LENGTH;