Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Carlo Cabrales 58 posts 77 karma points
    Oct 15, 2010 @ 14:13
    Carlo Cabrales
    0

    concat quotes to search term in xsltsearch

    I downloaded the xsltsearch package and to perform multi word searches you need to use double quotes before and after the term.

    Is there a way I can concatinate quotes to the term?


  • Rik Helsen 670 posts 873 karma points
    Oct 15, 2010 @ 15:08
    Rik Helsen
    0

    don't know if this helps, but if it's in xslt you can use the concat function:

    concat('"',$yoursearchterm, '"')

     

  • Carlo Cabrales 58 posts 77 karma points
    Oct 15, 2010 @ 15:33
    Carlo Cabrales
    0

    Hrmm.. I feel silly not being able to resolve this but i'm a beginner. Xslt won't allow me to save this..I'm sure there's a syntax error

        <xsl:variable name="search">
        <xsl:value-of select="concat('&quot;',$search, '&quot;')"/>
        <xsl:choose>
          <!-- form field value, if present -->
          <xsl:when test="string(umbraco.library:RequestForm('search')) != ''">
            <xsl:value-of select="ps:escapeSearchTerms(string(umbraco.library:RequestForm('search')))" />
          </xsl:when>
          <!-- querystring value, if present -->
          <xsl:when test="string(umbraco.library:RequestQueryString('search')) != ''">
            <xsl:value-of select="ps:escapeSearchTerms(string(umbraco.library:RequestQueryString('search')))" />
          </xsl:when>
          <!-- no value -->
          <xsl:otherwise>
            <xsl:value-of select="''"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
  • Rik Helsen 670 posts 873 karma points
    Oct 15, 2010 @ 15:39
    Rik Helsen
    0

    Try this:

        <xsl:variable name="search">&quot;
        <xsl:choose>
          <!-- form field value, if present -->
          <xsl:when test="string(umbraco.library:RequestForm('search')) != ''">
            <xsl:value-of select="ps:escapeSearchTerms(string(umbraco.library:RequestForm('search')))" />
          </xsl:when>
          <!-- querystring value, if present -->
          <xsl:when test="string(umbraco.library:RequestQueryString('search')) != ''">
            <xsl:value-of select="ps:escapeSearchTerms(string(umbraco.library:RequestQueryString('search')))" />
          </xsl:when>
          <!-- no value -->
          <xsl:otherwise>
            <xsl:value-of select="''"/>
          </xsl:otherwise>
        </xsl:choose>
    &quot;
      </xsl:variable>
  • Rik Helsen 670 posts 873 karma points
    Oct 15, 2010 @ 15:39
    Rik Helsen
    0

    ps. i haven't thought about what implications this would have on the search results

Please Sign in or register to post replies

Write your reply to:

Draft