Index ServiceNow knowledge blocks
Index ServiceNow knowledge blocks
If you’re using knowledge blocks in your ServiceNow instance, and your ServiceNow source is configured to index knowledge articles, the ServiceNow source automatically indexes the content of knowledge blocks that are included in knowledge articles.
When a user performs a query in a Coveo search interface that matches the content of a knowledge block, the search results show the knowledge article that contains the knowledge block only if the user is authorized to view the knowledge article.
Knowledge blocks are secured by user criteria in ServiceNow. This determines which users can read the block content within a given knowledge article. If a user doesn’t have read access to a knowledge block, but is authorized to view the corresponding knowledge article, the article still appears in the search results when the query matches the content of the knowledge block. However, the knowledge block doesn’t appear for the user within the article itself.
Note
Refer to Exclude knowledge blocks from Coveo search results for instructions on how to configure your ServiceNow source to not show knowledge blocks as separate results. |
Make the content of knowledge blocks searchable
Knowledge block metadata must be mapped to a specific index field in your ServiceNow source in order for the content to be searchable in a Coveo-powered search interface. This mapping is automatically added when you create a new ServiceNow source. However, if you created your ServiceNow source prior to support for the automatic-mapping feature, you must manually add the mapping to your source.
Perform the following steps to verify if the mapping currently exists for your ServiceNow source, and if not, add the mapping:
-
On the Sources (platform-ca | platform-eu | platform-au) page, click your ServiceNow source, and then click Mappings in the Action bar.
-
Click the Specific tab.
-
Click the
kb_knowledge
item type. -
In the field list that appears, verify if the
snkbblockscontent
field mapping appears in the list. If it appears, the mapping already exists for your source. Otherwise, perform the following steps to add the mapping:-
Click Add, and then select Mapping.
-
In the Apply a Mapping on Specific Item Types of a Source panel, under Field, select
snkbblockscontent
. -
Under Apply to, select Specific item types, and then select the kb_knowledge item type.
-
Under Rules, enter
%[coveo_knowledge_blocks]
. -
Click Apply mapping. The mapping now appears in the
kb_knowledge
field list. -
Click Save and rebuild source.
-
Exclude knowledge blocks from Coveo search results
By default, a knowledge block appears as a separate Coveo search result when the query matches the content of the knowledge block. This result is in addition to the result for the corresponding knowledge article that appears if the user is authorized to view the article. If a user selects the knowledge block result, it opens only the knowledge block content and not the article that contains the block.
Moreover, while your ServiceNow source indexes the content of knowledge blocks, it doesn’t index the permissions associated with the knowledge blocks. This means that if a user doesn’t have access to read the knowledge block in ServiceNow, the knowledge block still appears in Coveo search results.
To configure your ServiceNow source to not show knowledge blocks in Coveo search results, but still display the corresponding article, you must exclude the kb_knowledge_block
objects from the kb_knowledge
table in your source configuration as follows:
-
On the Sources (platform-ca | platform-eu | platform-au) page, click your ServiceNow source, and then click Edit in the Action bar.
-
Select the Content to include tab.
-
In the left pane, enter
kb_knowledge
in the search field to locate the system table in the list. -
Click the
Knowledge
table to open the corresponding column list in the right pane. -
Click Query in the column list header, and then enter the query expression
sys_class_name!=kb_knowledge_block
. -
Click Save and rebuild source.