requesting metadata for DB crawled results with a custom stylesheet

6 views
Skip to first unread message

manub

unread,
Nov 2, 2009, 5:08:14 AM11/2/09
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
Hi,

I'm indexing documents from a DB crawl, using a field of the record as
the SERVE URL. I put a crawl query to fetch the terms I need to index,
and I'm using a customized XSLT stylesheet (I put a column of the
record as the title for the rearch result).

But, even if I use the option getfields=<some metadata> into the
request, I can't get metadata to display.

I need that, for every search result, some metadata will be shown
under the result.

Do I need to furtherly customize the XSLT sheet in order to obtain
this?

Thank you.

Mike

unread,
Nov 2, 2009, 7:09:43 AM11/2/09
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
Hello,

the fields you index are just rendered into a standard html table in a
minimal html page. Therefore the appliance will index them as content
-- not meta tags!
So, in order to have them available as meta tags as well you will need
to modify your custom XML stylesheet to also put each value as a meta
tag into the head section of the minimal html page:
<head>
<title> my DB title </title>
<content name="column a" content="xzy" />
<content name="column b" content "abc" />
...
</head>
<body>
...

Hope it helps
Mike

manub

unread,
Nov 2, 2009, 9:35:27 AM11/2/09
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
Hi Mike,

thank you. It helped.

Anyway, still got some problems. I'd like to index 4 metadata for each
row, each metadata is the value of a db column.

I modified the <head> section of the XSLT this way:

<head>
<title><xsl:value-of select="database/table/table_rec/TitleColumn"/
></title>
<META NAME="Column1" />
<xsl:attribute name="value">
<xsl:value-of select="database/table/table_rec/Column1"/>
</xsl:attribute>
<META NAME="Column2" />
<xsl:attribute name="value">
<xsl:value-of select="database/table/table_rec/Column2"/>
</xsl:attribute>
<META NAME="Column3" />
<xsl:attribute name="value">
<xsl:value-of select="database/table/table_rec/Column3"/>
</xsl:attribute>
<META NAME="Column4" />
<xsl:attribute name="value">
<xsl:value-of select="database/table/table_rec/Column4"/>
</xsl:attribute>
</head>

I read something on the web about how to transform html <meta> tags
this way. But, when I sync my db, in the log got this error:

Recoverable error
at xsl:attribute on line -1 of :
Cannot write an attribute node when no element start tag is open

this is not repeated lots of times (about 20 on 31000 rows). I'm
guessing if I'm doing something wrong in the XSLT sheet. Can someone
help?

Thank you.

manub

unread,
Nov 2, 2009, 10:18:02 AM11/2/09
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
Fixed it using something like this:

<META name="Column1">
<xsl:attribute name="content">
<xsl:value-of select="database/table/table_rec/
Column1"/>
</xsl:attribute>
</META>

hope it helps you too!!!
Reply all
Reply to author
Forward
0 new messages