- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2018 08:32 AM
Is there really still no way to add additional knowledge bases to your service portal's search feature? Seems like this should be a simple configuration but everything I'm pulling up in my research suggests I have to customize this. We're using Jakarta.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2018 11:19 AM
This query is going against the database so any exceptions need to be "spelled" out in the code. You could add a "dot-walk" query around the same lines you were editing to filter only on active knowledgebases, but dot-walk queries cause table scans since it has to loop through all articles looking for ones where the knowledgebase is active. Depending on how many articles you have this could get expensive and cause performance issues.
How many KB's are you wanting to search? All of them or do you have a limited set? There may be a better way to gather the list of active knowledgebases to pass into this query.
Otherwise, a better You can add a check within the loop to see if the knowledgebase is active and if not continue past this article. So you would edit lines 15-16 in the script pasted above with:
// Does user have permission to see this item? Is the knowledgebase active?
if (!$sp.canReadRecord("kb_knowledge", kb.getUniqueValue()) || !kb.kb_knowledge_base.active)
continue;
Please mark this post or any as helpful or the correct answer to your question so others viewing this thread can benefit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2018 08:52 AM
Its possible by modifying the search source code. See this thread for details on a recent similar question:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2018 09:26 AM
Thanks Michael. I saw your answer listed and accepted. Where exactly does this code go?
var kbQuery = kb.addQuery('kb_knowledge_base', $sp.getValue('kb_knowledge_base')).addOrCondition('kb_knowledge_base', 'KB-2-SYSID').addOrCondition('kb_knowledge_base', 'KB-3-SYSID');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2018 09:33 AM
Goes into the Portal's search source.
Navigate to Service Portal \ Search Sources and you will find 3 out of the box records. The Knowledge base record is the one you need to modify. Open that record and you will need to modify the Data fetch script, out of the box line 7 where its querying for a specific kb_knowledge_base record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2018 10:08 AM
Here's what I have. I'm not sure if this is ootb or not. If it is I can just add this line of code at the end of line 7?
.addOrCondition('kb_knowledge_base', 'KB-2-SYSID').addOrCondition('kb_knowledge_base', 'KB-3-SYSID');
with KB-2-SYSID and KB-3-SYSID as the sys id's of the KB's I want to add.