Connector Framework Server 25.3
Connector Framework Server Help

# write_idx

The `write_idx` function writes a document to disk as an IDX file. If you specify the name of an existing IDX file, the document is appended to the file.

## Syntax

    write_idx( doc, outputFilename [, archiveDirectory [, maxSizeKBs
       [, shouldUseSections]]] )

## Arguments

Argument | Description
--- | ---
`doc` | (LuaDocument) The document to be written to an IDX file.
`outputFilename` | (string) The filename of the output IDX file.
`archiveDirectory` | (string) The folder to which IDX files are archived when they reach the maximum size. The default folder is the current directory (`.`)
`maxSizeKBs` | (integer) The maximum size of an IDX file (in kilobytes) before it is archived. To specify no maximum size, use the value `-1`. This is the default setting.
`shouldUseSections` | (string) Specifies whether to divide the document into sections. `True`. Divide the document into sections. `False`. Do not divide the document into sections. This is the default setting. `Empty string`. Use the default settings for sectioning.

## Returns

Boolean. Returns `true` if the IDX file was created successfully, and `false` otherwise.

## Examples

Copy

    1
    2
    3
    function handler(document)
       return write_idx(document, "my_new_idx_file")
    end

Copy

    1
    2
    3
    4
    5
    function handler(document)
       local was_idx_written = write_idx(document,
              "idx_files/main_file.idx", "archive_idx_files", 1024, "true")
       return was_idx_written
    end

Copyright 2025 Open Text
Version 25.3 | Last updated July 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery Connector Framework Server 25.3

Topic Title: write_idx