"Knowledge" word in Virtual Agent Contextual search topic block from Orlando and on


Description

In Orlando and on, users will see the word "knowledge" on the Contextual search result list.

Release or Environment

Orlando and on.

Cause

This is expected. This is not a defect from the application it is actually an enhancement to show different context labels for each result added from Orlando.


Resolution

Here are the changes the customer needs to make to disable the 'knowledge' keyword label
Orlando:
Contextual Search -
i. Open Virtual agent > Designer > Contextual Search, Duplicate the Topic Block
ii. Click 'Edit Topic Flow'
iii. Click on 'Display multi-link' node, In the Response properties open 'Link List Value Expression'
iv. In the script window, Replace
"groupedLinksOutMsg.addLinkPart(link.label, link.link, link.description, link.context_label);"
With
"groupedLinksOutMsg.addLinkPart(link.label, link.link, link.description, '');"
v. Click on save

Paris:
Contextual Search -
i. Open Virtual agent > Designer > Contextual Search, Duplicate the Topic Block
ii. Click on 'Flow' tab
iii. Click on 'Display multi-link' node, In the Response properties open 'Link List Value Expression'
iv. In the script window, Replace existing script with
(function execute(header) {
    var variables = {
        limit: vaVars.limit,
        index: vaVars.index,
        search_result_json_string: vaVars.search_result_json_string,
        portal: vaInputs.portal
    }
    //var contextualSearch = new global.VAGlobalContextualSearchUtilCopy();
    //var groupedLinksOutMsg = contextualSearch.getLinks(header, variables);
    var groupedLinksOutMsg = new sn_cs.GroupedPartsOutMsg();
    groupedLinksOutMsg.setHeader(header);
    var limit = parseInt(variables.limit);
    var searchJsonObj = JSON.parse(variables.search_result_json_string);
    var index = parseInt(variables.index);
    var portal = variables.portal;
    var linkBuilder = new global.cxs_SearchResultLinkBuilder();
    for (var i = index; i < index + limit && i < searchJsonObj.length; i++) {
        var link = linkBuilder.build(searchJsonObj[i], portal);
        if (link && link.link) {
            var contextText = link.context_label;
            groupedLinksOutMsg.addLinkPart(link.label, link.link, link.description, '');
        } else
            index++;
    }
    return groupedLinksOutMsg;
})(header)

v. Click on save


On testing, you can see that the "knowledge" label is removed. Customers can use this duplicated topic block as required