A common error people are experiencing with the Umbraco package called XsltSearch is the "Context: unavailable" bug, whereby search results show the "Context: unavailable" message instead of text snippet where the search query is found.
This error is officially generated when a field is entered in the "searchFields" string but not in the "previewFields" string. You should check this is not the case. Also, note that properties prefixed with an "@" sign are not allowed in the "previewFields" string so this will also cause the error.
Another cause for this error is an error in the actual XSLT coding.
<xsl:template name="displayFieldText">
<xsl:param name="item"/>
<xsl:param name="fieldList"/>
<xsl:variable name="fieldName">
<xsl:value-of select="PS.XSLTsearch:getFirstElement($fieldList,
',')"/>
</xsl:variable>
<xsl:variable name="remainingFields">
<xsl:value-of select="PS.XSLTsearch:removeFirstElement($fieldList,
',')"/>
</xsl:variable>
<!-- actually print out field, if it exists
and has content -->
<xsl:if test="count($item/*[not(@isDoc) and
name()=string($fieldName)]) = 1 and string($item/*[not(@isDoc) and
name()=string($fieldName)]) != ''">
<xsl:value-of select="string($item/*[not(@isDoc) and
name()=string($fieldName)])"/>
</xsl:if>
<xsl:if test="$remainingFields != ''">
<!-- if this element does not exist,
go on to the next one -->
<xsl:call-template name="displayFieldText">
<xsl:with-param name="item" select="$item"/>
<xsl:with-param name="fieldList" select="$remainingFields"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
Thanks to "Niels van Roden" for the original posting of this fix.
|
© 2009 Added Value Applications
|