Spice up your search results view in UCM

One of the things that I use on our internal UCM instance here at Oracle is my own custom search results view. I like the standard Headline View because each result is a nice, concise display for each document. But what I don't like about it is the lack of information about the document. I can add additional columns, but that can quickly hit a limit given the width of results.

So what I've done is try and combine the best of both worlds. My initial results that comes back looks just like the regular Headline View.


But if I simply click on the Title in the results, it expands and shows additional information that I want to get at. And in addition to that information, I can present actions that may only be available on the Content Information page. Or even actions that aren't available in either place (like delete all revisions).


So when you customize a search result, it lets you insert code right into the Description field to add this type of functionality. And when you show additional options, it lets you insert code that would go above the search results.

To make this somewhat portable, I have all of my code in an .idoc file that I have checked in. Then I use the docLoadResourceIncludes() function in the additional options area to pull in the resources. That way if I want to reuse this on another instance, or share this with someone else to use, it's just a few lines of code that need to be added.

For those interested in these results, here is a copy of my

.idoc file
. To create the custom view:

  1. Check in the .idoc file. Make note of the Content ID for it.

  2. On the Search Results page, select View -> Customize.

  3. Add a new Headline View template. Give it a name and ID.

  4. For Customize Columns, select Content ID and Description.

  5. Check the 'Use Advanced Description Form' check box.

  6. In the Customize Description Column text area, enter:

        <$include dh_main_information$>

  7. Click the 'show additional options' link.

  8. In the text area that appears below, enter:


        <$include dh_advanced_options$>

    You'll want to change the dDocName parameter to the Content ID of the .idoc file that was checked in.

  9. Save the template.


Hi, Kyle -- Thanks for this extremely enlightening example. While I'm excited to try your Idoc include technique for all of the reasons you mention, it is also true that Oracle should make it easier for us to create custom views based on existing views. For example and in keeping with your statement ... I like the standard Headline View because each result is a nice, concise display for each document. But what I don't like about it is the lack of information about the document. ... if we create a new Headline view based on the default Headline view, the new view is devoid of the fields that made the default Headline view useful, and we have to start filling it with fields from scratch. In many cases, I suspect that we would not need as powerful and elaborate an example as you provide if the new (in this case, Headline) view inherited the characteristics of the view from which is was made, and we could then delete the fields that we didn't want to make room for the ones that we do want. Don

Posted by Don Glascock on January 28, 2010 at 01:22 AM CST #

Hey Don, Very good point. I often hear the feature request to allow the administrator/power-user create a view and expose that to all users to be able to re-use (like we do with Targeted Quick Searches). But creating a new view based off an existing one would also be very helpful. I'll be sure to add this as a feature request in our system. Be sure to have support do the same the next time you speak with them. It carries more weight coming from a customer then me. :-)

Posted by kyle.hatlestad on January 28, 2010 at 02:41 AM CST #

Hi, Kyle -- I also requested this enhancement. Thanks again for this cool, over-the-top example!

Posted by Don on February 05, 2010 at 12:45 AM CST #

Thank you so much for very useful information. I have followed all the steps, but somehow it does not work. I am a newbie in UCM, what could I've done wrong? May be there are some related issues to be considered? :)

Posted by Gulnara on March 16, 2010 at 04:52 AM CDT #

I have fixed it! It was all about spaces! :)

Posted by Gulnara on March 16, 2010 at 05:12 AM CDT #

Dear Kyle, it works wonderful! Do you know how the same can be done for folders or at least how to configure folder view? Thanks a lot!

Posted by gulnara on March 16, 2010 at 07:43 PM CDT #

and one more question, what is the Markup(Autoview) functionality? It returnes an error page to me. Thanks =)

Posted by gulnara on March 16, 2010 at 07:46 PM CDT #

Hello Gulnara, I'm afraid the display mechanism for folders and content in folders is different then search results and does not have the same template custom template displays. So to get a result view like this one would require a custom component to add that additional view.

Posted by kyle.hatlestad on March 17, 2010 at 11:47 PM CDT #

Hey Gulnara, The AutoVue functionality is a productized integration that UCM has with Oracle AutoVue. AutoVue is a viewing, markup, and collaboration tool for working with hundreds of different types of file types including Office documents, PDFs, images, and CAD drawings. So if you can imagine a scenario in which you would have users workflow a piece of content like a contract and during the review cycle, each reviewer could add their red-lining and notes to the document without actually changing the document itself. Or how about being able to do that in real-time with several users and then be able to save those markups for reference later. That's a solution that AutoVue brings. Or if you're a manufacturer and you need your users to view certain blueprints or 3-D CAD drawings, but not everyone has that native CAD application, the AutoVue viewer allows you to view those files. You can hear more about the integration in this podcast.

Posted by kyle.hatlestad on March 17, 2010 at 11:58 PM CDT #

Hi Kyle, Thanks for the info! It was very useful. Is there a way to show to the text say first 2 lines (content) in the document rather than the associated metadata in search result page? Also is there a way to get tags in the search result page? I am able to do full text search looking at some possibilities to display some lines in the search result. Thanks!

Posted by Anusha on March 18, 2010 at 03:55 PM CDT #

Hey Anusha, If you are using Verity as the search engine, the variable <$VDKSUMMARY$> will give you the first 200 characters or so of the content. If you are using database full-text searching and have run the batchsnippet.sql query against your database, you can get the snippet of text surrounding the term that you searched for (like how Google results work). That variable is <$srfDocSnippet$>. As for tags, any metadata can be exposed in those search results. It's simply a matter of calling that field name like <$xComments$>. Thanks, Kyle

Posted by kyle.hatlestad on March 30, 2010 at 05:36 AM CDT #

Hi Kyle, Very cool..thanks. However for some reason Description details are blank after saving and conducting a search. Any help would be appreciated. Thanks

Posted by Mike on June 18, 2010 at 07:30 AM CDT #

Hey Mike, I'm not sure. If you have a typo when you are setting up your custom view, that could cause the field to be blank. You might see an error in the server output if there is a script error. If you view the source on the page, is the field truly blank?

Posted by kyle.hatlestad on June 21, 2010 at 11:22 AM CDT #

Kyle, Our local developer looks over my shoulder and says "I think you're supposed to put the Content ID where is says DYNAMIC_HEADLINE". What can I say....I only lurned how tu tern kumpooter on last week. Anyway...works like a charm in Firefox but my IE7 has seizures when I select that template. Thanks

Posted by Anonymous on June 22, 2010 at 11:51 PM CDT #

Hi Kyle, this example is really cool. I was looking at building a custom results view leaving out the 'Actions' column with the Info link and action button. Is that something I can achieve using this approach?

Many thanks in advance

Posted by guest on November 07, 2011 at 09:47 PM CST #

No, the actions menu is outside the control of the custom search results choices. So changes to that would require a custom component.


Posted by Kyle Hatlestad on November 08, 2011 at 02:13 AM CST #

I'm thinking this will not work in UCM 7.5?

Posted by guest on December 02, 2011 at 08:09 AM CST #

Hi Kyle,

I am using site studio search fragment plain box / result paged in my site. I made a copy of build in search result paged fragment to cutomise the way it shows me search result content files.
Following is my code:

<!--$loop SearchResults-->
<!--$docName = eval('<$' & ssDisplayField & '$>') -->
<dd class="<!--$ssClassName-->-result" <!--$ssColorExtra-->
<a class="<!--$ssClassName-->-result" <!--$ssColorExtra-->
<!--$ssMouseExtra--> href="<!--$SearchResults.ssUrl-->"><!--$ssIncludeXml(docName,"wcm:root/wcm:element[@name='ContentHeading']/text()")-->

This code displays First title element from content file and then its content. As my files are based on a region definition that have two elements "ContentHeading" and "innerpage_content".

Now what i want is to only display few lines of text from element "innerpage_content" that matches ssUserText.

Kindly guide me how can i do this. Need urgent help.
Regards Sadia

Posted by guest on December 14, 2011 at 04:31 PM CST #

Hi Kyle

do we know have any means to centralise a pre configured template for all users and also make sure it is set initially. As being said, the default searc results columns do not make much sense to our audience unkless we don't add a few custom fuilds.

Thanks for some hints


Posted by Shonu on April 25, 2012 at 04:45 AM CDT #

I want to enable the include sub folders check box in the search page foe all the profiles in my UCM10g. Please tell me do we have any configuration option for this or any customization required... Thanks

Posted by prabhu on July 03, 2012 at 04:25 AM CDT #

Hello Prabhu,

It should be enabled by default. If not, you can add CollectionSearchRecursiveContent=1 in your configuration parameters of the server.


Posted by Kyle Hatlestad on July 10, 2012 at 09:00 AM CDT #

Hi Kyle,

Your posts have always been a big helo to me and I have used your current technique in few of my previous implementations. Thanks a ton.

Now, I am stuck with a requirement which is puzzling me. Pretty much what few other guys have mentioned already. A cutom view available to all the users.

1) I tried to create a "Query" in the weblayout editor, it works perfect but again I don't see any way I can add/delete the default columns. I want to add few custom columns globally for this Query without individual users creating a custom view.

2) I see the only extent to which I can customise "StandardResult" template is to update "Text1" and "Text2". How do I further customise this template ? As in add or delete columns.

Please suggest.

Thanks :)

Posted by Aashish on July 11, 2012 at 11:45 PM CDT #

Hi Kyle,
I am creating a website using Oracle UCM. I am implementing a page as a staticlist which has two elements IMAGE and CONTENT side by side in each row.To customise for the user i have kept Image element optional as each row might not require an image element so i need to use different CSS in the two cases. I want to know which Idoc function to use to check if image field has been left blank by the contributor...
Please reply

Posted by guest on July 12, 2012 at 03:15 PM CDT #

Hi Kyle

First of all, thank you for your blog.
I have a question on this subject: with new "Framework Folders" substituting "Folders_g" component, how can you retrieve a content path to build the link to the container folder for this spiced search results?
I've been trying with "ownerFilePath" without success...

Thx in advance

Posted by guest on February 15, 2013 at 05:52 AM CST #


Yes, to get the folder paths available in Framework Folders, you first need to set the server configuration flag 'FolderPathInSearchResults=true'. Then upon the search results, the variable that will contain the path is <$folderPath$>. One thing to note is this does have an impact on search results by increasing the number of database queries to gather the folder path information as noted in this blog post: https://blogs.oracle.com/ATEAM_WEBCENTER/entry/webcenter_content_web_search_performance


Posted by Kyle Hatlestad on February 15, 2013 at 09:09 AM CST #

Hi Kyle

Thank you.
I need to set custom search result view as default to all users or add to Change View menu.
If it's possible?


Posted by Leon on March 20, 2013 at 02:40 AM CDT #

Hello Leon,

Having custom search result views available to all users is a common request, but afraid it's not possible without developing a custom component.


Posted by Kyle Hatlestad on March 26, 2013 at 09:50 AM CDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Kyle Hatlestad is a Solution Architect in the WebCenter Architecture group (A-Team) who works with WebCenter Content and other products in the WebCenter & Fusion Middleware portfolios. The WebCenter A-Team blog can be found at: https://blogs.oracle.com/ ateam_webcenter/


« July 2016