AI Search Genius Result Configuration form
Summarize
Summary of AI Search Genius Result Configuration form
The AI Search Genius Result Configuration form allows ServiceNow customers to create and manage Genius Result configurations for use in AI Search profiles. This functionality lets you define custom conditions and scripts to trigger specialized search result cards, enhancing the relevance and presentation of AI Search outputs.
Show less
Key Features
- Name: Assign a unique identifier for each Genius Result configuration.
- Trigger Condition: Determines when the Genius Result activates. Options include:
- Always: Triggers for every search query.
- NLU: Triggers when the search query’s intent matches a linked, published NLU model and intent.
- Term: Triggers on exact matches of specified query terms, requiring precise word order.
- Term: Specify the exact search term that activates the Genius Result; appears only if "Term" is selected as the trigger condition.
- Application: Automatically set scope defining where the configuration applies.
- Active: Enable or disable the Genius Result configuration; inactive configurations do not trigger.
- Processor Script Template: Provides a sample server-side script to help build AI Search request and response processor scripts.
- AI Search Request Processor: A required server-side script (if response processor is not used) that modifies or defines a search query based on the triggering query. It returns up to three results to display as Genius Result answer cards. Uses APIs like
GeniusResultAnswer.setTable()and.addSearchPhrases(). Note thatgetMatchingDocuments()is not usable here. - AI Search Response Processor: A required server-side script (if request processor is not used) executed after search computation. It returns key-value pairs to display on the answer card, defined using
GeniusResultAnswer.addDataMap(). The fields to display are specified in the Return Fields list. - Return Fields: Specifies which fields from the response processor’s output appear on the Genius Result answer card. If only the request processor is used, common AI Search index fields display by default, with optional additional fields specified here.
Practical Use and Benefits
By configuring Genius Result setups, ServiceNow customers can tailor AI Search to present highly contextual, intent-driven search results with custom answer cards. This improves user experience by delivering precise information snippets or actions directly within search results, driven by exact terms or natural language understanding.
The scripting capabilities provide flexibility to define how search queries are processed and how results are presented, enabling advanced customization without modifying core AI Search functionality.
The AI Search Genius Result Configuration form enables you to create a Genius Result configuration for use in your AI Search search profiles.
For details on creating or editing a Genius Result configuration, see Create a Genius Result configuration.
| Field | Description |
|---|---|
| Name | Name for the Genius Result configuration. |
| Trigger condition | Condition that triggers evaluation of the Genius Result configuration.
Supported values:
|
| Term | Term that triggers the Genius Result configuration when it exactly matches the search query. This field appears only when you select Term from the Trigger condition field. |
| Application | Application scope for the Genius Result configuration. This field is automatically set. |
| Active | Option to activate the Genius Result configuration. Inactive Genius Result configurations never trigger. |
| Processor script template | Sample server-side script function. Use the code displayed in this field as a basis for your AI Search request processor and AI Search response processor scripts. This field is automatically set. |
| AI Search request processor | Server-side script function that takes a GeniusResultContext object as its parameter. The function must return a GeniusResultAnswer object that contains a search query. Up
to three results from this search query display as Genius Result answer cards. Note:
This field is required if AI Search response processor isn't populated. You can copy the code from the
Processor script template to use as a starting point for your script function. When a search query triggers the Genius Result configuration, the system executes this script and then sends both the triggering search query and the scripted search query to the AI Search back end for computation of search results. To define a search query, use the GeniusResultAnswer.setTable(), GeniusResultAnswer.addSearchPhrases(), and GeniusResultAnswer.setSearchPhrase() API methods. For details of API methods usable in this script function, including examples of use, see the GeniusResultAnswer and GeniusResultContext scoped JavaScript API descriptions.
Note: The GeniusResultContext.getMatchingDocuments() API method returns
no results when invoked in an AI Search request processor script, since the script is executed before AI Search computes results for the triggering search query. Don't use this method in your request processor scripts. |
| AI Search response processor | Server-side script function that takes a GeniusResultContext object as its parameter. The function must return a GeniusResultAnswer object that defines one or more maps of
key-value pairs. You can display these key-value pairs on the Genius Result answer card by specifying them as Return fields. Note:
This field is required if AI Search request
processor isn't populated. You can copy the code from the Processor script template to use as a starting point for your script function. When a search query triggers the Genius Result configuration, the system executes this script after AI Search computes search results. To define your map of key-value pairs, use the GeniusResultAnswer.addDataMap() API method. Each key-value pair represents a field name and value that you can display on the Genius Result answer card using the Return fields list. For details of API methods usable in this script function, including examples of use, see the GeniusResultAnswer and GeniusResultContext scoped JavaScript API descriptions. |
| Return fields | Comma-separated list of fields to display on the Genius Result answer card. This field is required if AI Search response processor is populated.
Behavior depends on which processor script field is populated:
|