Search Scripted Post-processors form
Summarize
Summary of Search Scripted Post-processors form
The Search Scripted Post-processors form in ServiceNow is used to create and manage post-processing scripts that modify search results within AI Search application configurations. These scripts allow you to customize how search results are presented or transformed after the initial search query is executed.
Show less
Key Features
- Active: Enable or disable the post-processor script.
- Name: Assign a unique name to the post-processor for identification.
- Application: Automatically set to define the scope of the post-processor.
- Type: Specify the record type the script operates on, such as Genius Result or Search Result.
- Post processing script: Write a server-side function that receives a record object and modifies it as needed before the search results are returned. For example, you can transform date fields into human-readable formats.
The form also provides an overview of available API methods to assist in writing your post-processing scripts, enabling efficient customization of search result data.
Practical Use and Access
ServiceNow customers can use this form to tailor search result data presentation, improving user experience by making data more understandable or relevant. For instance, the included example script converts the sysupdatedon date into relative time descriptions like "2 hours ago."
You can view and reuse existing scripts by accessing the syssearchscriptedprocessor table in list view. This helps accelerate development by leveraging pre-built scripts as templates.
The Search Scripted Post-processors form contains information about post-processing scripts defined in search application configurations for AI Search. Use this form when creating or modifying search scripted post-processors.
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:
|