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.

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 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:

  1. On the Sources page, click your ServiceNow source.

  2. In the Action bar, click More, and then select Manage mappings.

  3. Click the Specific tab.

  4. Click the kb_knowledge item type.

  5. 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:

    Search-result
    1. Click Add, and then select Mapping.

    2. In the Apply a Mapping on Specific Item Types of a Source panel, under Field, select snkbblockscontent.

    3. Under Apply to, select Specific item types, and then select the kb_knowledge item type.

    4. Under Rules, enter %[coveo_knowledge_blocks].

    5. Click Apply mapping. The mapping now appears in the kb_knowledge field list.

    6. 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:

  1. On the Sources page, click your ServiceNow source.

  2. In the Action bar, click Edit.

  3. Click the Content to include tab.

  4. In the left pane, enter kb_knowledge in the search field to locate the system table in the list.

  5. Click the Knowledge table to open the corresponding column list in the right pane.

  6. Click Query in the column list header, and then enter the query expression sys_class_name!=kb_knowledge_block.

  7. Click Save and rebuild source.

What's Next for Me?