- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 07:11 AM
The Service Portal search results return in this sequence.
We would like to change the sequence (Left Box) to Service Catalog, Knowledge Base and Question and Answers. Also the search results (list window on right) in the same sequence. Our goal is to direct users to the Service Catalog first. I found sys.properties "glide.service_portal.default_search_sources" and changed it to the sequence we want but it does nothing or is overwritten.Thanks in advance. Jim
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 11:38 AM
You would have to clone and modify the Search Page widget.
In the HTML template, change:
<div role="listitem" ng-repeat="item in data.results | orderBy:'score':true | limitTo:data.limit" class="panel-body b-b ">
to
<div role="listitem" ng-repeat="item in data.results | limitTo:data.limit" class="panel-body b-b ">
In the server script, add orderBy call to this piece of code:
} else {
var m2mSearchSourceGR = new GlideRecord("m2m_sp_portal_search_source");
m2mSearchSourceGR.orderBy('order'); // <<-- ADD THIS LINE
if (data.t)
m2mSearchSourceGR.addQuery("sp_search_source.id", data.t);
m2mSearchSourceGR.addQuery("sp_portal", $sp.getPortalRecord().getUniqueValue());
m2mSearchSourceGR.query();
while(m2mSearchSourceGR.next()) {
var searchSourceGR = m2mSearchSourceGR.getElement("sp_search_source").getRefRecord();
data.resultTemplates["sp-search-source-" + searchSourceGR.getValue("id") + ".html"] = $sp.translateTemplate(searchSourceGR.getValue("search_page_template"));
getResults(searchSourceGR);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 02:36 PM
Hello Nia, thanks for the code. Works as you indicated. My first customization on SP. You may see more questions. Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 02:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2017 06:54 AM
Would this also resolve the popup window below the Search Box on the homepage of the portal?
We have the same issue, but it's affecting the popup box under the homepage search box (We have an Access Request catalog item buried under Knowledge Articles):
Please mark this response as correct and/or helpful if it assisted you with your question.
Steven

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2017 07:34 AM
Hi Steven,
No the above code would not change the way the popup works. For that, I believe you'd have to modify the Typeahead Search widget in a similar fashion as above. The key is modifying the search code to respect the order:
m2mSearchSourceGR.orderBy('order'); // <<-- ADD THIS LINE
Though, i haven't actually tried this. You might also want to consider what effect this has on the ordering of results by relevance before you change anything, as I believe that's the default.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2017 07:38 AM
I just noticed it appears there is a problem ticket open for this:
With included, and I assume updated, widgets attached to it.
Please mark this response as correct and/or helpful if it assisted you with your question.
Steven