AI Search "Page not found" "aisa-result-sys_attachment" error in portal


Description

When searching for certain text in a Record Producer that has 'AI Search Assist' implemented, we see the 'Page not found' 'The page you are looking for could not be found.' and 'aisa-result-sys_attachment' errors showing in the 'AI Search Assist' widget when stepping off the field.

Steps to Reproduce

Prerequisites: Setup AI Search

1) Go to Service Portal -> Get Help -> Create Incident (<instance>/sp?id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9&sysparm_category=e15706fc0a0a0aa7007fc21e1ab70c2f)
2) Type in "email" into "Please describe your issue below"
3) Get the top result and attach the pdf attached to this defect to the kb article
4) Do step 1 and 2 again

Actual result: "The page you are looking for could not be found." error is shown with "aisa-result-sys_attachment". Some results are still shown under the error.
You can look in the browser console in the network tab and find the search call. In the response you can see a sys_attachement record in the response
Expected result: Only Catalog Items and Knowledge Articles are shown with no errors

Workaround

- Navigate to Sevice Portal -> Widgets

- Open the AI Search Assist widget

- Click on New in the Angular ng-templates

- Set the id to:

aisa-result-sys_attachment

- Set the Template to:

<div id="{{result.sysId}}" class="aisa-result-container">
</div>

Related Problem: PRB1511997