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 configure scripted post-processors within AI Search application configurations. These post-processors enable custom server-side scripts to modify search result records after they are retrieved, enhancing the relevance or presentation of search data before it is displayed to users.
Show less
Key Features
- Activation Control: Easily activate or deactivate the scripted post-processor using the Active option.
- Scope Definition: Assign a name and application scope (automatically set) to organize and manage the post-processor.
- Record Type Selection: Specify whether the script operates on Genius Result answer records or standard search result records.
- Custom Server-side Scripting: Write a server-side script function that processes individual search result records. This function receives a record object and can alter its fields dynamically.
- API Support: The UI provides an overview of available API methods for post-processing scripts to facilitate development.
- Script Reuse: Copy and adapt code from existing post-processor scripts accessed via the syssearchscriptedprocessor table in list view.
Practical Example
The documentation includes a sample script that transforms sysupdatedon date fields from the kbknowledge table into human-friendly relative time expressions (e.g., "5 minutes ago," "1 day ago"). This illustrates how to customize search result display dynamically based on content.
What This Enables You to Do
By using the Search Scripted Post-processors form, ServiceNow customers can tailor AI Search results to better meet business needs through custom logic applied after search retrieval. This enhances user experience by presenting search results in more readable, relevant, or actionable formats without modifying the underlying data sources.
How to Access and Manage Existing Scripts
Existing post-processor scripts can be accessed and edited by navigating to the syssearchscriptedprocessor table via list view. This helps in managing and improving your search post-processing logic over time.
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:
|