Connector Framework Server 25.3
Connector Framework Server Help

# Customize the Query

The `CategorySuggestFromText` Lua script sends an entire document (metadata and content) to a Category component for categorization. The document is converted to a string using the `to_idx` method and then passed to the `QueryText` parameter of the `CategorySuggestFromText` action:

    local categorySuggestFromTextParameters = { QueryText = document:to_idx() }

    ...

    local output = send_aci_action(
    		idolCategorizeHost,
    		idolCategorizePort,
    		"categorysuggestfromtext",
    		categorySuggestFromTextParameters,
    		timeoutMilliseconds,
    		retries,
    		sslParameters
    		)

You can modify the script to categorize the document based on a specific field. For example, to use only the document content:

    local categorySuggestFromTextParameters = {
                          QueryText = document:getContent()
                          }

Alternatively, to use the value of a single document field:

    local categorySuggestFromTextParameters = {
                          QueryText = document:getFieldValue("MyFieldName")
                          }

You can also add additional parameters to the action. For example, the `CategorySuggestFromText` Lua script does not limit the number of categories that are added to the document. To add only the most relevant category to a document, add the `CategorySuggestFromText` action parameter `NumResults=1` by modifying the script as follows:

    local categorySuggestFromTextParameters = {
                          QueryText = document:getContent(),
                          NumResults = 1
                          }

For more information about the `CategorySuggestFromText` action and the parameters that it supports, refer to the Category Component Help.

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: Customize the Query