Copied to clipboard

Flag this post as spam?

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


  • andersc 5 posts 25 karma points
    Jul 06, 2011 @ 14:40
    andersc
    0

    I cannot get correct search results by XSLTsearch

    I am a newbie of umbraco. After I deploy this CMS on server, I tried many of the features in setting, it works well. Today I installed XSLTsearch package, the only changes are in XSLTsearch template:

    1. change ContentPlaceHolderId's value from "Runway..." to "ContentPlaceHolderDefault";
    2. surround the macro using <form runat="server">...</form> 

    Then, I create a page using this template, whatever I input in the textbox, it always show message like "Searched 1 pages in 0.003 seconds".

    I have used Luke to check the index files, there are about 15 documents, why it only search one page? What config item should I modify?

    And in the template I change source's value from "-1" to "1065", it could find the page of id 1065, but it still just searches 1 page, so confusing. In the xslt file, there is a node: <xsl:param name="currentPage"/>, is this the reason?

    Please help me...

  • Fuji Kusaka 2203 posts 4220 karma points
    Jul 06, 2011 @ 18:12
    Fuji Kusaka
    0

    Hey andersc,

    Are you usind XSLT Search or Index Search??

     

    //fuji

  • andersc 5 posts 25 karma points
    Jul 07, 2011 @ 03:51
    andersc
    0

    hi fuji,

    I am using XSLT Search, thanks for your reply.

  • Fuji Kusaka 2203 posts 4220 karma points
    Jul 07, 2011 @ 06:52
    Fuji Kusaka
    0

    Hey andersc,

     

    Try to change <form runat="server">...</form> to <form method="get" action="search.aspx?"> </form> in your XSLT Search template.

    What version of umbraco are you using btw?

    //fuji

  • andersc 5 posts 25 karma points
    Jul 07, 2011 @ 09:56
    andersc
    0

    hi fuji,

    my version is 4.7.

    at the beginning, i think XSLT search uses lucene index:), now i see it just uses XSLT to search properties in pages, right?

    i just made a "big" progress, when i set the source value to "1092"(a folder's id), it can find the pages out! But when i set its value to "-1", it just search 1 page and find nothing, why?

  • Fuji Kusaka 2203 posts 4220 karma points
    Jul 07, 2011 @ 11:39
    Fuji Kusaka
    1

    Hi Andersc,

    So far you are getting only the results of a particular node right?

    What you can do is set your Macro source="-1" then under Developer Section Open your XSLTsearch and Look for :

     

     <xsl:when test="number($source)= -1 or number($source)= 0">
            <!-- using ALL nodes -->
            <xsl:call-template name="search">
              <!-- searches absolutely all pages (useful if you want to search multiple sites at once, or if you do not have all your content pages below a common homepage node in the content tree)        -->  
            
    UnComment this part
             <xsl:with-param name="items" select="umbraco.library:GetXmlAll()/*"/>
              Comment this part       

             <!--  searches all pages within a specific site (useful if you have multiple sites in one umbraco installation) 
              <xsl:with-param name="items" select="$currentPage/ancestor-or-self::* [@level = '1']"/>-->
            </xsl:call-template>
          </xsl:when>

     

     

    //fuji

  • andersc 5 posts 25 karma points
    Jul 08, 2011 @ 04:01
    andersc
    0

    Hi Fuji,

    Really tons of thanks for your help!

    Finally I can search the pages, in this process I found I need to learn more about XSLT, it seems like the heart of Umbraco's macro.

  • Fuji Kusaka 2203 posts 4220 karma points
    Jul 08, 2011 @ 06:07
    Fuji Kusaka
    0

    Hey Andersc

     

    Good to hear your search is finally working....

     

    //fuji

  • Stuart Neal 9 posts 29 karma points
    Sep 28, 2011 @ 11:00
    Stuart Neal
    0

    Very useful, I had the same problems. Many thanks.

  • anilreddy 12 posts 27 karma points
    Nov 02, 2011 @ 05:03
    anilreddy
    0

    I had same problem...and thank you very much for solving this :)

Please Sign in or register to post replies

Write your reply to:

Draft