Google Search Appliance SMB URLs

I’m running a proof of concept at work of the Google Search Appliance (GSA). Work’s very much a Microsoft Windows shop and for the demo I wanted the SMB search results to link to the files on the SMB share, not the GSA proxy that is the default.

You can hack this with this small change to the XLST, a git-diff as follows:

diff --git a/gsa-original b/gsa-smb
index ba1c66f..73751ab 100644
--- a/gsa-original
+++ b/gsa-smb
@@ -2680,8 +2680,7 @@ for (var j = 1; j < p.length; j++) { url += "&amp;" + p[j]; }}
         </xsl:when>
        <!-- *** URI for smb or NFS must be escaped because it appears in the URI query *** -->
         <xsl:when test="$protocol='nfs' or $protocol='smb'">
-         <xsl:value-of disable-output-escaping='yes'
-                       select="concat($protocol,'/',$temp_url)"/>
+         <xsl:value-of disable-output-escaping='yes' select="concat('file://', substring-after(U, '://'))"/>
         </xsl:when>
         <xsl:when test="$protocol='unc'">
           <xsl:value-of disable-output-escaping='yes' select="concat('file://', $display_url2)"/>

Now, after you collect your jaw from the floor when you realise that this will create URLs like file://servername/path/to/file, please remind yourself of the earlier caveats of hack and Windows. This actually took longer that it should have to debug as Firefox on Linux isn’t insane enough to make this work.

If the POC works out and we decided to go ahead with the GSA use, I’d be searching for something a bit more robust (and if I’m working on it, I’ll share the details of what we decide to do!).

Comments

These are imported from this site's old blogging software and are kept for archival reasons.

Hi there,

thanks for the great help. Did you find different solution ?

Thanks Ravi

Hi Ravi,

Sorry I haven’t, it’s not a product I’ve worked on for a few years now. Good luck with your search!

Cheers,

Henare

Thanks Henare for taking time to reply.

Best Regards, Ravi