- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2014 01:47 PM
Hello--
Can anyone please help me how to configure the Search Results in CMS. I am stuck to get the correct UI Macro/code base which actually generates the search results. My requirement is to display the search results in tabular form (Service Catalog and KB).
I have found that UI Macro "text_search_widget" is being called from "content_search" form. But not sure how this macro generates the search results. I am happy with the search results returned from CMS Search functionality, but just wanted to play with the search content.
I also have looked into ess CMS search implementation and found one UI Macro named "ts_group.xml" is being called (<g:call function="ts_group.xml" group_id="${jvar_ts_groupid}" query="$[sysparm_query]" />) from Dynamic Content - "Search Results". However, could not find any macro named "ts_group", but did find a table of this name. Not sure how they have implemented OoO global/cms search.
Could anyone know from where (code base) the search results are being generated for CMS?
I appreciate your help!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2014 08:32 AM
Are the links getting changed from the DOM manipulation or are they showing up incorrectly to begin with? It looks like it's not set up to show correctly.
When links are generated automatically in the CMS typically Content Types are used. In the Content Types there is some built-in functionality to generated links but sometimes things are done manually to give a little more control. You'll need to look at that. I'd start with making sure you've got a Content Type record defined for the site and table combination that the records are from and that those Content Type records have the Default Detail Page filled in. When you copy a CMS site it will copy the Content Types along with the rest of the content but if you created the site from scratch or just copied pages then you'll need to go in and make copies of the Content Types or create new ones for the site.
If that's all in place then you may need to look at the Summary Template field to make sure it's got code in there to generate the link. It could be a g:content_link tag, but it could also be code to manually create the link.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2014 11:05 AM
Thank you very much James for your reply!
We also just had identified the issue and rectified the same. The bad URL issue was due to not creating a Content Type of kb_knowledge and not configuring the Page Detail setting for Knowledge Detail.
The issue has now been resolved. Attached is a snapshot of the actual results page!
Thank you once again James for your kind help on this.
Regards,
Sudipta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2014 11:10 AM
James, just wanted to know few more things from you. Could you please provide some details on below questions:
1. GlideRecord query "gr.addQuery('123TEXTQUERY321', search_term);" what type of object it returns?
2. How do we hold the object and iterate over it?
3. If ts_group.xml is OoB macro which we can't change?
Thanks once again!
Regards,
Sudipta

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2014 01:37 PM
Using "123TEXTQUERY321" is just part of the GlideRecord object that is used throughout ServiceNow. It is a special case that allows for using the ServiceNow Zing search engine to do the filtering in addition to the regular querying that happens with addQuery. So iterating through the results is just the same using "while(gr.next())" as the loop.
ts_group.xml is Jelly Script that is stored in a file that is not accessible to admins so we can't change it. I haven't seen the code, but with most all of the code like that, it's just Jelly Script similar to a UI Macro or UI Page and so anything in there could be done by an admin, but since they haven't exposed that code you'd be writing from scratch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2014 05:37 AM
Thank you James!