Search
Clear search
Close search
Google apps
Main menu

How to show username in search results

Summary: You want to see username on the results page of a secure search

Fix: To display the username in search results you can enable the User Alerts feature.

To enable alerts for a search appliance in the Admin Console:

  1. Go to Index > Alerts.
  2. Click Enable.
  3. Click Save.
  4. Go to Search > Search Features > Front Ends.
  5. Click Edit for a specific frontend.
  6. Open Global Attributes in the Page Layout Helper section under Output Format.
  7. Select the Show Alerts Link.

Authenticated users will then see their username in the top-right corner of the results page (on a default front-end).

If you are using customized XSLT, you can use the default front-end as a reference for displaying the username.

Please note that the username is removed from raw XML output (if query URL does not contain the "proxystylesheet" query parameter).

If you want  to have the username in raw XML output (for example, you have web application that gets results from the GSA in XML format), you have to create a separate front-end that will return unmodified XML output.

It can look like this:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> 
<xsl:output method="xml" indent="yes" /> 
<xsl:template match="/"> 
<xmp> 
<xsl:copy-of select="*"/> 
</xmp> 
</xsl:template> 
</xsl:stylesheet>   
 

After providing this front-end in the "proxystylesheet" query parameter you can get the following XML output (please note <LOGIN> tag):

<GSP VER="3.2"> 
<TM>0.103972</TM> 
<Q>test</Q> 
<PARAM name="site" original_value="default_collection" value="default_collection"/> 
<....> 
<PERSONALIZATION/> 
<LOGIN>crawler</LOGIN> 
</GSP>   
 

Additional Information: Please see this document for further information on User Alerts.

Versions affected: 7.4, 7.6 releases

Was this article helpful?
How can we improve it?