AIS | AI Search general troubleshooting and debugging<!-- .SOKMKBArticle div.margin { padding: 10px 40px 40px 30px; color: #283d40; font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; } .SOKMKBArticle div.fed{ background-color: #f5f8fa; border: 1px solid; border-color: #bfbfbf; padding: 10px; } .SOKMKBArticle .FedRestricted{ background-color: #c00000; color: #ffffff; padding: 10px; margin-top: 10px; text-align: center; font-size: 14pt; font-weight: bold; } .SOKMKBArticle .CustRestricted{ background-color: #ff0000; color: #ffffff; padding: 10px; margin-top: 10px; text-align: center; font-size: 14pt; font-weight: bold; } .SOKMKBArticle .SNRestricted{ background-color: #ea700d; color: #ffffff; padding: 10px; margin-top: 10px; text-align: center; font-size: 14pt; font-weight: bold; } .SOKMKBArticle .SNConfidential{ background-color: #ffc000; color: #ffffff; padding: 10px; margin-top: 10px; text-align: center; font-size: 14pt; font-weight: bold; } .SOKMKBArticle .Public{ background-color: #00b050; color: #ffffff; padding: 10px; margin-top: 10px; text-align: center; font-size: 14pt; font-weight: bold; } .SOKMKBArticle table.tocTable { border: 1px solid; border-color: #f2f2f2; background-color: #f2f2f2; padding-top: .6em; padding-bottom: .6em; padding-left: .9em; padding-right: .6em; } .SOKMKBArticle table.noteTable { align: left; border: none; border-color: #81b5a1; background-color: #f2f2f2; width: 100%; border-spacing: 2; font-size: 11px; } .SOKMKBArticle table.internalTable { border-top: 1px solid; border-left: 1px solid; border-color: #81b5a1; width: 100%; border-spacing: 1px; } .SOKMKBArticle .sp td { border-bottom: 1px solid; border-right: 1px solid; border-color: #81b5a1; background-color: #ffffff; height: 20px; padding-top: .5em; padding-bottom: .5em; padding-left: .5em; padding-right: .5em; } .SOKMKBArticle .sphr td { border-right: 1px solid; border-bottom: 1px solid; border-color: #81b5a1; background-color: rgb(245, 245, 245); padding-top: .5em; padding-bottom: .5em; padding-left: .5em; padding-right: .5em; height: 20px; } .SOKMKBArticle .sh td { border-bottom: 1px solid; border-right: 1px solid; border-color: #81b5a1; background-color: #81b5a1; color: #ffffff; height: 20px; padding-top: .5em; padding-bottom: .5em; padding-left: .5em; padding-right: .5em; } .SOKMKBArticle th { padding-top: .5em; padding-bottom: .5em; padding-left: .5em; padding-right: .5em; border-bottom: 1px solid; border-right: 1px solid; border-color: #81b5a1; background-color: #283d40; font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; color: #ffffff; height: 20px; } .SOKMKBArticle td { border-color: #81b5a1; margin: 5px 5px 5px 5px; font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; color: #283d40; } .SOKMKBArticle p { color: #283d40; font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; } .SOKMKBArticle li { color: #283d40; font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; line-height: 1.5; } .SOKMKBArticle pre { font-family: Courier New; } .SOKMKBArticle div { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; } .SOKMKBArticle hr { border-top-width: 1px; border-top-style: solid; border-top-color: #81b5a1; } .SOKMKBArticle a { color: #81b5a1; } .SOKMKBArticle a.two:link { padding: 15px 45px 15px 45px; margin-top: 20px; color: #ffffff; text-align: center; background-color: #1F8476; border: 1px solid; border-color: #1F8476; } .SOKMKBArticle a.two:visited { padding: 15px 45px 15px 45px; margin-top: 20px; color: #ffffff; text-align: center; background-color: #1F8476; border: 1px solid; border-color: #1F8476; } .SOKMKBArticle a.two:hover { color: #ffffff; background-color: #259b8a; } .SOKMKBArticle .button { padding: 15px 45px 15px 45px; margin-top: 20px; color: #ffffff; text-align: center; background-color: #1F8476; border: 1px solid; border-color: #1F8476; } .SOKMKBArticle .title { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #81b5a1; font-size: 30pt; } .SOKMKBArticle .hd1 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-size: 20pt; border-bottom: 1px solid; border-bottom-color: #81b5a1; text-decoration: none; } .SOKMKBArticle h1 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-size: 20pt; font-weight: normal; border-bottom: 1px solid; border-bottom-color: #81b5a1; text-decoration: none; } .SOKMKBArticle .hd2 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #68a1af; font-weight: bold; font-size: 16pt; text-decoration: none; } .SOKMKBArticle h2 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #68a1af; font-weight: bold; font-size: 16pt; font-weight: normal; text-decoration: none; } .SOKMKBArticle .hd3 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: normal; font-size: 14pt; text-decoration: none; } .SOKMKBArticle h3 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: normal; font-size: 14pt; text-decoration: none; } .SOKMKBArticle .hd4 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: normal; font-size: 12pt; text-decoration: none; } .SOKMKBArticle h4 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: normal; font-size: 12pt; text-decoration: none; } .SOKMKBArticle .hd5 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: bold; font-size: 10pt; text-decoration: bold; } .SOKMKBArticle h5 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: bold; font-size: 10pt; text-decoration: bold; } .SOKMKBArticle .hd6 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: normal; font-size: 10pt; text-decoration: underline; } .SOKMKBArticle h6 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: normal; font-size: 10pt; text-decoration: underline; } .SOKMKBArticle details { font-size: 10pt; } .SOKMKBArticle details[open] summary ~ * { animation: sweep .5s; margin-top: 0; padding-top: 10px; } @keyframes sweep { 0% {opacity: 0; margin-top: -10px} 100% {opacity: 1; margin-top: 0px} } .SOKMKBArticle summary { cursor: pointer; outline: none; margin-bottom: 3px; } .SOKMKBArticle .summary { background-color: #81b5a1; font-size: 10px; color: white; cursor: pointer; padding: 5px; width: 100%; border: none; text-align: left; outline: none; vertical-align: top; } --> Description This article talks about the basic troubleshooting and debugging steps for working on AIS issues Troubleshooting and Debugging AI Search 1. In order to turn on the logs, From the filter navigator System Diagnostics > Debug AI Search You can see similar debug messages below 2. You could check for logs by navigating to AI Search > All or AI Search > Ingestion Warnings & Errors. Refer AI Search logging and debugging 3. Use Search Preview UI by installing the application Advanced AI Search Management Tools and once the app is installed Navigate to Ai Serch > Preview > Search Preview 3. a. Choose the search profile on the dropdown on the top left 3.b. In the field which says 'Search here' enter the search term > Hit 'Search' button 4. check localhost logs as well. 5. If you would like to test the search query for an NLU model, you could search from "Scripts - background' and check the results and debug logs //Enter the solution name you are testing in the line #1 like ml_x_snc_sn_km_mr_global_ais_gra_b8bc699a67621010b3d782f45685efa5var geniusSearchSolutionName = 'enter the solution name'; var searchQuery = new sn_ml.GeniusSearchQuery("abraham lincoln");var searchContext = new sn_ml.GeniusSearchContext({"session" : ""});var geniusSearchSolution = sn_ml.GeniusSearchSolutionStore.get(geniusSearchSolutionName)geniusSearchSolution = sn_ml.GeniusSearchSolutionStore.get(geniusSearchSolutionName);var result = geniusSearchSolution.search(searchQuery, searchContext, {});gs.print(JSON.stringify(JSON.parse(result), false, 4)); 6. Along with the Search Preview UI, you can use the below script to debug the results with search profile or narrow down the search issue. The AISASearchUtil API below is unsupported and should only be used for debugging purposes. //Make changes to the searchParams based on your requirements.//Just need to change searchContextConfigId and searchTerm to get started.searchParams = { searchContextConfigId: '00731b9d5b231010d9a5ce1a8581c7dd', //sys_id of the Search Application configuration[sys_search_context_config] record that you want to use for searching. searchTerm: '***', // The search term *** returns all records that have been indexed. paginationToken: '', // Leaving paginationToken empty returns the data for the first page. To get the paginationToken for 2nd page, click the next page button on the portal after doing the search and check the URL for paginationToken. disableSpellCheck: false, facetFilters: [], searchFilters: [], requestedFields: {}, rpSysId: 'test' // Just a dummy value that is needed for the script to work.};var aiSearchUtil = new AISASearchUtil();var result = aiSearchUtil.search(searchParams);var searchResult = result.data.search.searchResults;gs.info(searchResult.length);for (var i=0; i<searchResult.length; i++){gs.info(searchResult[i].title + " | " + searchResult[i].text);}gs.info(JSON.stringify(result));//Note: Ensure that search sources have been indexed before trying to search. Common spot checks to perform if AI Search does not display search results: 1. Check if AI Search is enabled 'glide.ais.enabled' should be set to true. and also check AI Search > Connection > Test Connection If there are any connection issues, please reach out to Tech Support2. If the Genius results are not being returned check if 'glide.ais.genius_result.enabled' is set to 'true', 2.a. Check if facet is clicked and then genius result is not displayed then check 'glide.ais.genius_result.enabled_with_facet_filter' to false 2.b. If for any non-English language Genius results are not working, because it's not supported. Genius results is supported only for English even though AI Search supports several languages Refer Internationalization support for AI Search 2.c. If the Genius result is not working check if there is an EVAM configuration is added for the corresponding Genius result. For example Peoplefind Genius result will not work unless you add one manually in sys_ux_composite_data_template_predicate_bundle, See EVAM Configuration 3. If the expected results are not displayed > then check the following 3.a. Check if the correct 'Search Profile' is being linked 3.b. Check if the 'Search Profile' is 'Published' if not publish again and retest 4. If the expected results are not present, check the 'Search Source' filter condition. For example, if a 'search source' filters out certain records, then those records would never show up in the results. Other reasons would be ACL, Domain Separation, User Criteria and Before Query Business Rules. 5. If expected number of results are not displayed, go to the Search application configuration (sys_search_context_config) and check the search results limit Other issues with AI Search: 1. Check if Edge encryption, Encryption support is enabled since this is not supported as of Quebec 2. If any event-related issue Event queue where all event starts with "ais_index" 3. For any performance-related issues identify the content security features that are being applied to search results. •Are there many User Criteria being evaluated? •Are there many ACLs on the tables that are being searched? Be careful when testing AI Search performance in cloned non-production instances. The same dedicated AI Search nodes handle search query traffic from all of your instances. As a result, search queries on non-production instances may impact search query performance in your production instance. 4. If AI Search modules are missing, see if you had a recent clone, contact Tech Support and you may also refer them to KB0967216( This is a Servicenow internal KB) 5. If you can not enable AI Search for certain Service Portals, Then likely it is not available. AI Search can be enabled for all custom created Portals however for OOB portals/Store portals if it's available it will be enabled by default. 6. Task,cmdb related tables and other tables in the zing block list can not be indexed with the exception of sc_cat_item and kb_knowledge. If a parent table is indexed and all the child tables should also be manually added and indexed. Reference AI SearchAI Search reference AI Search logging and debugging Search Preview UI Advanced AI Search Management Tools