Copied to clipboard

Flag this post as spam?

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


  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Nov 25, 2011 @ 00:18
    Bo Damgaard Mortensen
    0

    Passing variable to Examine search

    Hi all,

    I'm currently toying around with Examine in XSLT. The problem is, that when I do this:

    <xsl:value-of select="umbraco.examine:SearchMemberOnly('My searchterm', 'true', 'MemberSearcher')"/>

    I get the correct data back.

    But when I try to pass in a variable with the search term, I get the "No results" error? Is it possible at all to do what I want? :-)

    Thanks in advance.

    - Bo

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 25, 2011 @ 00:23
    Chriztian Steinmeier
    0

    Hi Bo,

    How are you creating the variable?

    These should all behave equally:

    <xsl:variable name="searchString" select="'My searchterm'" />
    <xsl:variable name="querySearch" select="umbraco.library:RequestQueryString('q')" />
    
    <xsl:value-of select="umbraco.examine:SearchMemberOnly('My searchterm', true(), 'MemberSearcher')" />
    
    <xsl:value-of select="umbraco.examine:SearchMemberOnly($searchString, true(), 'MemberSearcher')" />
    
    <xsl:value-of select="umbraco.examine:SearchMemberOnly($querySearch, true(), 'MemberSearcher')" />
    
    (Unless the method takes a (C#) string as argument 2, you should be sure to use a real XSLT boolean to make sure it behaves as you think the day you need to pass false in instead :-) 

    /Chriztian

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Nov 25, 2011 @ 00:43
    Bo Damgaard Mortensen
    0

    Chriztian, you rock!

    The only thing that needed to change was 'true' to true() as you mentioned and I'm now getting results back.

    Thank you soooo much! :)

    - Bo

Please Sign in or register to post replies

Write your reply to:

Draft