Copied to clipboard

Flag this post as spam?

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


  • Fengelz 106 posts 221 karma points
    Jun 11, 2010 @ 08:57
    Fengelz
    0

    short text searches.

    I have recently implemented xslt search on a site once again and experience strange behaviour when searching for specific frases. fx:

    "/search-result.aspx?search=er" redirects to another page

    "/search-result.aspx?search=r" and "/search-result.aspx?search=e" redirects to that same page.

    "/search-result.aspx?search=a" redirects to another page.

    "/search-result.aspx?search=re" gives me the search results I want.

    In other words, certain small search terms acts strange and gives the error message "Failed to load source for: http://mypage.dk/search-result.aspx?search=er" in firebug.

    Do you know if anyone else has experienced this? Or do you have any idea what it might be?

    Thanks again for a great package.

    Cheers Sune Fengel

     

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 11, 2010 @ 09:32
    Matt Brailsford
    0

    I belive Doug is aware of this and is working on an updated version of XSLTSearch. Just a case of watch this search.

    You could implement something in the mean time to only search on say a minimum of 3 characters?

    Matt

  • Fengelz 106 posts 221 karma points
    Jun 11, 2010 @ 10:04
    Fengelz
    0

    Ok I'll do that :)

    - Sune

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 11, 2010 @ 11:14
    Matt Brailsford
    0

    That was meant to be "watch this space", but I'm sure you knew that =)

    Matt

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jun 11, 2010 @ 18:37
    Douglas Robar
    0

    There is no known bug with short searches, except a quirk with the letter 's' sometimes. And XSLTsearch never does a redirect of any kind so I don't think the behavior is XSLTsearch related specifically.

    Can you show us the macro properties you're using. Any chance of a live url so I can see the behavior myself?

    cheers,
    doug.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 11, 2010 @ 20:10
    Matt Brailsford
    0

    Ahhhh, my bad. I remembered talking about it, but forgot the full detail.

    Matt

  • Fengelz 106 posts 221 karma points
    Jun 21, 2010 @ 13:18
    Fengelz
    0

    Hi Doug Sorry I didnt see your reply until now.

    <umbraco:Macro runat="server" 
            Alias="XSLTsearch" 
            macroAlias="XSLTsearch" 
            source="-1" 
            searchFields="@nodeName,metaKeywords,metaDescription,bodyText,Tags" 
            previewFields="bodyText,metaDescription,tags" 
            previewType="beginning" 
            searchBoxLocation="hidden" 
            resultsPerPage="1000" 
            previewChars="255" 
            showPageRange="0" 
            showOrdinals="0" 
            showScores="0" 
            showStats="0">
    </umbraco:Macro>

    you can see the behaviour here 

    http://kundeconew.fserver.dk/search-result.aspx?search=er 

    (which redirects)

    vs.

    http://kundeconew.fserver.dk/search-result.aspx?search=top

    (which performs the xslt search)

    Any help would of course be appreciated, but just knowing that this is no normal xsltsearch bug, makes me want to test the page thoroughly.

    best regards

    - Sune

     

  • Fengelz 106 posts 221 karma points
    Jun 21, 2010 @ 14:27
    Fengelz
    0

    I've also setup a barebone xsltsearch stripped of everything else here 

    http://kundeconew.fserver.dk/search-result-test.aspx?search=test

    The masterpage:

    <%@ Master Language="C#" AutoEventWireup="true" %>
    
    
                <umbraco:Macro runat="server" 
            Alias="XSLTsearch" 
            macroAlias="XSLTsearch" 
            source="-1" 
            searchFields="@nodeName,metaKeywords,metaDescription,bodyText,Tags" 
            previewFields="bodyText,metaDescription,tags" 
            previewType="beginning" 
            searchBoxLocation="top" 
            resultsPerPage="1000" 
            previewChars="255" 
            showPageRange="0" 
            showOrdinals="0" 
            showScores="0" 
            showStats="0">
                </umbraco:Macro>
  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jun 21, 2010 @ 20:07
    Douglas Robar
    0

    Hi, Sune,

    Thanks for the link to the site. I have to say I am absolutely at a loss to explain this behavior. I want to say it isn't XSLTsearch because it has no redirection at all in it. I have a feature request for automatically redirecting to a page if there is only a single return to the search but that won't be included until a future version.

    Is there any chance you'd let me log into your site? If you'd be comfortable with that, please contact me through my website, http://www.percipientstudios.com/about/contact.aspx

    cheers,
    doug.

  • Fengelz 106 posts 221 karma points
    Jun 22, 2010 @ 10:11
    Fengelz
    0

    Sure thing Doug.

    We have a presentation for the customer today so if it's okay I'll contact you tomorrow morning with login details.

    best regards

    - Sune

    PS. Dont spend too much time debugging as there is a good possibility that the error is within our site ;)

  • Fengelz 106 posts 221 karma points
    Jun 22, 2010 @ 14:04
    Fengelz
    0

    Hello again Doug.

    I managed to debug and fix the problem.

    though I dont know what the exact problem was, I found out that the issue was that I made a change in your XSLTsearch.xslt file to return the output for the matching nodes like this:

    <!-- page name and url -->
    <xsl:value-of disable-output-escaping="yes" select="umbraco.library:RenderTemplate(@id, 1295)"/>
                                        

    Somehow specific pages in the searchresults triggered a redirect when rendering the template.

    I fixed it by taking the content of the template and implementing it in xslt the "standard" way like this:

    <!-- page name and url -->
    <!--<xsl:value-of disable-output-escaping="yes" select="umbraco.library:RenderTemplate(@id, 1295)"/>--> <div class="heading"> <h2> <xsl:value-of select="data [@alias = 'SearchHeader']"/> <em class="date"> <xsl:value-of select="umbraco.library:FormatDateTime(@createDate, 'dd-MM-yyyy')"/> </em> </h2> </div> <div class="block searchResults"> <h3 class="searchResultsHeader"> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </h3> <div class="box no-topline"> <div class="block-holder"> <xsl:value-of select="data [@alias = 'body']" disable-output-escaping="yes"/> </div> <div class="keywords"> <dl> <dt>Keywords: </dt> <dd> <xsl:variable name="tagsArray" select="Exslt.ExsltStrings:split(string(data[@alias='Tags']),',')"> </xsl:variable> <xsl:for-each select="$tagsArray"> <a href="/search-result.aspx?search={.}"> <xsl:value-of select="."/> </a> <xsl:choose> <xsl:when test="position() != count($tagsArray)">, </xsl:when> </xsl:choose> </xsl:for-each> </dd> </dl> </div> </div> </div>

    and problem was solved.

    But thanks for your help and again, thanks for a great package.

    best regards

    - Sune

Please Sign in or register to post replies

Write your reply to:

Draft