Whatever message this page gives is out now! Go check it out!
docService.load(config)config argument is a Struct with the following keys:Key | Type | Default | Description |
|---|---|---|---|
path | String | — | Required. File path, directory path, or URL to load documents from. |
recursive | Boolean | false | When loading from a directory, recursively traverses subdirectories. |
parallel | Boolean | false | Enables parallel document loading for filesystem sources. |
maxThreads | Numeric | 4 | Maximum number of parallel worker threads used when parallel = true. |
includePatterns | Array of String | — | Glob patterns for files to include (for example, ["*.txt"]). |
excludePatterns | Array of String | — | Glob patterns for files to exclude (for example, ["*draft*"]). |
pattern | String | — | Legacy glob pattern for file selection (for example, "*.{pdf,txt}"). |
charset | String | "UTF-8" | Character encoding used for text-based formats. |
parserType | String | Auto-detected | Explicit parser to use instead of auto-detection. |
parserConfigs | Struct | {} | Per-parser configuration overrides. Supported sub-keys: csv (rowPerDocument, contentColumns, metadataColumns), json (jsonPath, contentKey), xml (includeAttributes), properties (sortKeys). |
maxFileSize | Numeric (bytes) | 100 MB | Maximum allowed file size. Files exceeding this limit are skipped. |
requestOptions | Struct | {} | HTTP request options used when loading from a URL. Keys: headers (Struct), connectionTimeout (ms), readTimeout (ms), maxRetries (Numeric), userAgent (String). |
text (String): Extracted document text.metadata (Struct): Contains source, fileName, fileSize, mimeType.docs = docService.load({
path: "./manuals/",
recursive: true,
pattern: "*.pdf"
});
writeOutput("Loaded #arrayLen(docs)# documents");docs = docService.load({
path: dir,
recursive: true,
parallel: true,
maxThreads: 4,
includePatterns: ["*.txt"],
excludePatterns: ["*draft*"],
charset: "UTF-8",
parserConfigs: {
csv: {
rowPerDocument: true,
contentColumns: ["name", "description"],
metadataColumns: ["id", "category"]
},
json: {
jsonPath: "$.articles[*]",
contentKey: "body"
}
}
});docs = docService.load({
path: "https://example.com/data.txt",
requestOptions: {
headers: {
"Authorization": "Bearer #token#"
},
connectionTimeout: 60000,
readTimeout: 120000,
maxRetries: 2,
userAgent: "ColdFusion-RAG/1.0"
}
});