- 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 11:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 11:21 AM

- 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 11:52 AM
Thanks I will give it a try. Jim