Search Scripted Post-processors form
Summarize
Summary of Search Scripted Post-processors form
The Search Scripted Post-processors form in ServiceNow allows you to create and manage search scripted post-processors within AI Search application configurations. These post-processors enable custom server-side scripting to modify search result records after they are retrieved, enhancing the search experience by transforming or enriching data before display.
Show less
Key Features
- Activation Control: You can activate or deactivate each scripted post-processor using the Active option.
- Identification: Each post-processor has a Name and is associated with an Application scope, which is automatically set.
- Type Specification: Specify the type of records the script will operate on, either Genius Result records or Search Result records.
- Post-processing Script: Define a server-side JavaScript function that takes a record object parameter and modifies it as needed. For example, you can transform date fields into human-readable formats within search results.
- API Methods Overview: The UI provides an overview of API methods available for use in the script, aiding in script development.
- Reusable Scripts: You can leverage existing post-processor scripts as templates by accessing them through the syssearchscriptedprocessor table in list view.
Practical Application
By using search scripted post-processors, ServiceNow customers can tailor search result data presentation dynamically. For instance, converting technical date/time fields into user-friendly phrases like "2 hours ago" improves readability and user engagement. This customization ensures that AI Search results are more relevant and easier to interpret, enhancing the overall search experience in your ServiceNow environment.
How to Access Existing Post-processors
To find and reuse existing search scripted post-processor scripts:
- Navigate to the "All" applications.
- Enter
syssearchscriptedprocessor.listin the Filter navigator and press Enter. - This brings up the list view of all scripted post-processors for review and copying.
The Search Scripted Post-processors form enables you to create a search scripted post-processor in the search application configuration for an AI Search application.
For details on creating or editing search scripted post-processors, see Using search scripted post-processors in AI Search application configurations.
| Field | Description |
|---|---|
| Active | Option to activate the search script post-processor. |
| Name | Name for the search script post-processor. |
| Application | Application scope for the search script post-processor. This field is automatically set. |
| Type | Type of record the search script post-processor operates on.
Valid values:
|
| Post processing script | Server-side script function that takes a record object as its parameter. When the search scripted post-processor is linked to a search application configuration, search results reflect changes made to
the record object in this script function.
As an example, this post-processing script function operates on search results from the kb_knowledge table, transforming sys_updated_on date field values into a human-readable
format:
Note: The UI displays an overview of API methods usable in the post-processing script function. You can copy code from an existing post-processor script to use as a starting point for your own script function. To access existing post-processor scripts, open the Search Scripted Post-processors
[sys_search_scripted_processor] table in list view by following these steps:
|