Created
October 6, 2010 06:00
-
-
Save tingletech/612901 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet> | |
<!-- in xtf queryParser.xsl --> | |
<!-- autocomplete on title --> | |
<xsl:template match="/" mode="autocomplete"> | |
<xsl:variable name="stylesheet" select="'style/crossQuery/resultFormatter/oac4/autoFormatter.xsl'"/> | |
<query indexPath="index" termLimit="1000" workLimit="20000000" | |
style="{$stylesheet}" startDoc="{$startDoc}" maxDocs="20" normalizeScores="false"> | |
<and maxSnippets="0"> | |
<!-- additional search limits --> | |
<and field="title"> | |
<xsl:apply-templates select="parameters/param[@name='query']/token" mode="autotitle"/> | |
</and> | |
</and> | |
</query> | |
</xsl:template> | |
<!-- do a wildcard search on the last word --> | |
<xsl:template match="token[position()=last()]" mode="autotitle"> | |
<xsl:variable name="value"> | |
<xsl:value-of select="@value"/> | |
<xsl:text>*</xsl:text> | |
</xsl:variable> | |
<or> | |
<near slop="13"><term><xsl:value-of select="$value"/></term></near> | |
<near slop="13"><term><xsl:value-of select="@value"/></term></near> | |
</or> | |
</xsl:template> | |
<xsl:template match="token" mode="autotitle"> | |
<term><xsl:value-of select="@value"/></term> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment